Monday, November 9, 2015

Matching PID to SID & SID to PID & SQL_TEXT using SID


Identify OS process ID based on database SID

select a.sid, a.serial#,a.username, a.osuser, b.spid
from v$session a, v$process b
where a.paddr= b.addr
and a.sid='&sid'
order by a.sid;

How to find out PID using SID

select pid, sid
from v$process, v$session
where v$process.addr = v$session.paddr
and sid = ###;

How to find "sql_text" using SID

select
a.sid,
a.serial#,
b.sql_text
from
v$session a,
v$sqlarea b
where
a.sql_address=b.address
and
sid= ###;


----Nikhil Tatineni----
----Oracle in memory----

Querys to monitor RAC

following few  Query's will help to find out culprits-  Query to check long running transaction from last 8 hours  Col Sid Fo...