根据sid或sqlID查询SQL

根据sid查询已经执行过的sql

select sql_text from v$sqlarea a,v$session b where a.SQL_ID=b.PREV_SQL_ID and b.SID=&sid;
--------------------------------------------------------------------------------------

根据sid查询当前执行的sql

select sql_text from v$sqlarea where (hash_value,address)=(select sql_hash_value,sql_address from v$session where sid=&sid);

posted @ 2017-04-27 14:49  Luca-  阅读(18722)  评论(0编辑  收藏  举报