相应语句如下:
作用:可以查找出运行时间的SQL,可以根据PID杀掉
点击(此处)折叠或打开
- SELECT *
- FROM (SELECT 'kill -9 ' || spid,
- v2.sid,
- v3.sql_text,
- v2.username,
- v2.command,
- v2.status,
- v2.client_info,
- v2.program,
- v2.terminal,
- v2.sql_address,
- v2.logon_time,
- (SYSDATE - v2.logon_time) * 86400 AS curtime,
- last_call_et,
- v3.executions,
- v3.parse_calls,
- v3.sharable_mem,
- buffer_gets,
- disk_reads,
- v2.event
- FROM v$process v1, v$session v2, v$sqlarea v3
- WHERE v1.addr = v2.paddr
- AND v2.username = 'JRZDUSER'
- AND v2.prev_sql_id = v3.sql_id(+)
- AND TYPE = 'USER')
- WHERE last_call_et > 180 --运行时间超过(180秒)
- AND sql_address <> hextoraw('00') --剔除已执行完毕的
- ORDER BY logon_time
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12762446/viewspace-1097301/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12762446/viewspace-1097301/