首先
从前台获取sid
然后
获取sql地址
select s.PREV_SQL_ADDR, s.SQL_ADDRESS from v$session s where s.sid = 192;
最后
获取sql文本
select * from v$sqltext_with_newlines t where t.ADDRESS = ‘070000001D924D68‘ order by t.piece;
合并sql
SELECT Sql_Text, s.Prev_Sql_Addr, s.Sql_Address FROM V$session s, V$sqltext_With_Newlines t WHERE s.Prev_Sql_Addr = t.Address(+) AND s.Sid = 393;
时间: 2024-11-05 16:06:20