2012/08/20

Published 8月 20, 2012 by with 0 comment

Find Oracle sid and Linux pid

Oracle sid and Linux pid
Sometimes we found Oracle process that has been running too long using top command on Linux. We know it has PID. But how to know the SID of the process?
Here is the script:



select
substr(a.spid,1,9) pid,
substr(b.sid,1,5) sid,
substr(b.serial#,1,5) ser#,
substr(b.machine,1,6) box,
substr(b.username,1,10) username,
substr(b.osuser,1,8) os_user,
substr(b.program,1,30) program
from
v$session b,
v$process a
where
b.paddr = a.addr
and type='USER'
order by spid;


 


Reference:http://orafin.blogspot.tw/2010/07/oracle-sid-and-linux-pid.html


0 意見:

張貼留言