oracle查询当前运行的进程
select a.program, b.spid, c.sql_text from v$session a, v$process b, v$sqlarea c where a.paddr = b.addr and a.sql_hash_value = c.hash_value and a.username is not null;
查询被锁的对象
SELECT a.object_id, a.session_id, b.object_name, c.* FROM v$locked_object a, dba_objects b, v$session c WHERE a.object_id = b.object_id AND a.SESSION_ID = c.sid(+)
杀Seesion的SQL
alter system kill session 'sid, serial#'
如上面查出来的一条记录的sid是53, serial#为663,就执行以下的语句 alter system kill session ‘53,663’
设置SQL语句计时
set timing on;
评论前必须登录!
注册