1.查得相对应的系统进程对应的session id
select sid from v$session where paddr in (select addr from v$process where spid=&PID);
2.根据所得的会话ID查得sql地址和hash值
SQL> select sql_address,sql_hash_value from v$session where sid=206;
SQL_ADDR SQL_HASH_VALUE
-------- --------------
6EC554F4 3141392848
3.根据sql hash值查得sql语句
SQL> select sql_text from v$sqltext where hash_value=3141392848;