当先锋百科网

首页 1 2 3 4 5 6 7
相应语句如下:

点击(此处)折叠或打开

  1. SELECT *
  2. FROM (SELECT 'kill -9 ' || spid,
  3.              v2.sid,
  4.              v3.sql_text,
  5.              v2.username,
  6.              v2.command,
  7.              v2.status,
  8.              v2.client_info,
  9.              v2.program,
  10.              v2.terminal,
  11.              v2.sql_address,
  12.              v2.logon_time,
  13.              (SYSDATE - v2.logon_time) * 86400 AS curtime,
  14.              last_call_et,
  15.              v3.executions,
  16.              v3.parse_calls,
  17.              v3.sharable_mem,
  18.              buffer_gets,
  19.              disk_reads,
  20.              v2.event
  21.       FROM v$process v1, v$session v2, v$sqlarea v3
  22.       WHERE v1.addr = v2.paddr
  23.       AND v2.username = 'JRZDUSER'
  24.       AND v2.prev_sql_id = v3.sql_id(+)
  25.       AND TYPE = 'USER') 
  26. WHERE last_call_et > 180 --运行时间超过(180秒)
  27. AND sql_address <> hextoraw('00') --剔除已执行完毕的
  28. ORDER BY logon_time
作用:可以查找出运行时间的SQL,可以根据PID杀掉

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12762446/viewspace-1097301/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12762446/viewspace-1097301/