1.查得相對(duì)應(yīng)的系統(tǒng)進(jìn)程對(duì)應(yīng)的session id
select sid from v$session where paddr in (select addr from v$process where spid=&PID);
2.根據(jù)所得的會(huì)話ID查得sql地址和hash值
SQL> select sql_address,sql_hash_value from v$session where sid=206;
SQL_ADDR SQL_HASH_VALUE
-------- --------------
6EC554F4?3141392848
3.根據(jù)sql hash值查得sql語句
SQL> select sql_text from v$sqltext where hash_value=3141392848;