Thursday, December 3, 2015

How to find out the sessions running from a package or procedure

Query:
=====

set lines 300
col SID for 0000
col USERNAME for a15
col EVENT for a32
col OSUSER for a10
col MACHINE for a15
col OBJECT_NAME for a40
select osuser,inst_id,sid,username,event,state,sql_id, last_call_et/60,prev_sql_id,s.status,PLSQL_ENTRY_OBJECT_ID,o.object_name  from gv$session s,dba_objects o where
s.PLSQL_ENTRY_OBJECT_ID=o.object_id and
s.PLSQL_ENTRY_OBJECT_ID is not null and o.object_name=upper('&object_name');


INPUT: Package/Procedure Name


Result: The above query shows the session details running from given package/procedure.

No comments:

Post a Comment