oracle查询当前运行的进程、查询被锁的对象、杀Seesion的SQL、设置SQL语句计时等教程
程序员文章站
2022-03-23 21:31:55
oracle查询当前运行的进程
select a.program, b.spid, c.sql_text
from v$session a, v$process b,...
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;
上一篇: mysql索引使用介绍
下一篇: SQL优化30条