Monday, February 4, 2019

Find oracle session based on a UNIX/Linux process ID

SELECT p.spid,

  s.sid,

  s.username,

  s.status,

  NVL(sql.sql_fulltext,'<no active SQL>') sql_text

FROM v$session s,

  v$process p,

  v$sql SQL

WHERE p.addr           = s.paddr

AND s.sql_id           = sql.sql_id(+)

AND s.sql_child_number = sql.child_number(+)

AND p.spid             =

  &os_pid /

No comments:

Post a Comment