How do I get Oracle, see what procedures are running?

混江龙づ霸主 提交于 2019-12-04 09:44:48

Depending on your needs, this might suffice (but relies on access to v$session and dba_objects):

select 'CALLED PLSQL', vs.username, d_o.object_name -- whatever info you need
  from dba_objects d_o
       inner join
       v$session vs
          on d_o.object_id = vs.plsql_entry_object_id
union all
select 'CURRENT PLSQL', vs.username, d_o.object_name
  from dba_objects d_o
       inner join
       v$session vs
          on d_o.object_id = vs.plsql_object_id

As per the docs:

PLSQL_ENTRY_OBJECT_ID - ID of the top-most PL/SQL subprogram on the stack; NULL if there is no PL/SQL subprogram on the stack

PLSQL_OBJECT_ID - Object ID of the currently executing PL/SQL subprogram; NULL if executing SQL

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!