SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('SQL_ID',SQL_CHILD_NUMBER));
一般 SQL_CHILD_NUMBER 为0 。
正在运行的抓'SQL_ID',SQL_CHILD_NUMBER
select a.sid,a.event,a.sql_id,a.sql_child_number,b.sql_text
from v$session a, v$sql b
where
a.sql_address = b.address
and a.sql_hash_value = b.hash_value
and a.sql_child_number=b.child_number
and a.username like '%SCOTT%'
order by 1 desc;