1 根据进程号查找占用资源的sql语句
select sess.username,sql1.SQL_TEXT from v$session sess,v$sqltext sql1,v$process pro
where sess.SQL_ADDRESS=sql1.ADDRESS and pro.ADDR=sess.PADDR and pro.SPID='&1' order by sql1.PIECE;
————————————————————————————————————————————————
2 查找相关对象的锁
select oracle_username,os_user_name,process,object_name,o.SESSION_ID from v$locked_object o,dba_objects d where o.OBJECT_ID=d.object_id and object_name='T_PLY_BASE';
————————————————————————————————————————————————
3 杀掉某模块的session
SELECT distinct 'ALTER SYSTEM KILL SESSION '''||s.SID||','||s.SERIAL#||''';',p.PID
FROM V$SESSION S,v$process p
WHERE s.PADDR=p.ADDR
and s.PROGRAM like '&1%';
阅读(1446) | 评论(0) | 转发(0) |