Oracle数据库中如何找到当前正在执行的SQL语句
SELECT a.program,
b.spid,
c.sql_text,
c.SQL_ID
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.program,
b.spid,
c.sql_text,
c.SQL_ID
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;
找到正在执行的SQL列表之后,通过 SQL_ID 在查询视图获得完整的SQL语句信息;
selecta.* from v$sql a where a.SQL_ID = '你要查找的SQL语句的SQL_ID的值';
(未完,待续)