Sometimes you see an operation process that takes up a lot of system resources, you need to figure out what this process is doing, and replace the red marked part with the operating system process ID (PID).
SELECT DISTINCT
'-------------------------------------------' | | Chr (10) | |
' Userame: ' | | S.username | | Chr (10) | |
' SCHEMA: ' | | S.schemaname | | Chr (10) | |
' Osuser: ' | | S.osuser | | Chr (10) | |
' Program: ' | | S.program | | Chr (10) | |
' SPID: ' | | S.sid | | Chr (10) | |
' serial#: ' | | s.serial# | | Chr (10) | |
' KILL STRING: ' | | "' | | S.sid | | ', ' | | s.serial# | | "' | | Chr (10) | |
' Machine: ' | | S.machine | | Chr (10) | |
' TYPE: ' | | S.type | | Chr (10) | |
' TERMINAL: ' | | s.terminal | | Chr (10) | |
' SQL ID: ' | | q.sql_id | | Chr (10) | |
' SQL TEXT: ' | | Q.sql_text into Block_info
From V$session S
, V$process P
, V$sql Q
WHERE s.paddr = p.addr
and S.sid = Bsid
and s.sql_id = q.sql_id (+);
Dbms_output.put_line (Block_info);
End
This article from "Oracle/db2/mysql" blog, declined reprint!
See what the process is doing based on the process ID (sq statement executed)