Tuesday, 2 December 2014

Trigger Event Monitor

Generally speaking the PL/SQL developer may not have access to all of the internal tables and views required to monitor PL/SQL performance.


As a minimum the developer needs SELECT access on:




select  a.TRIGGER_OWNER,a.TRIGGER_NAME,c.type_name object_type,a.TABLE_NAME,a.COLUMN_NAME
,REPLACE(b.ACT_UPDATE,'1','UPDATED') as "UPDATE_EVENT",REPLACE(b.ACT_INSERT,'1','INSERTED') as "INSERT_EVENT",REPLACE(b.ACT_DELETE,'1','DELETED') as "DELETE_EVENT",b.DEFINITION,b.PARSED_DEF,
trim(to_char(to_date(c.MTIME,'yyyy-mm-dd hh24:mi:ss'),'dd-mm-yyyy')) as "DATE"
from DBA_TRIGGER_COLS a,KU$_TRIGGER_View b,ku$_schemaobj_view c,obj$ d,V$session e
where a.trigger_owner=c.owner_name
and a.trigger_owner=e.username
/*and c.owner_name=e.username*/
and b.obj_num=c.obj_num
and d.obj#=c.obj_num
and d.name=a.trigger_name
and c.type_name='TRIGGER'
and e.status='INACTIVE'
and e.username='&ENTER_SCHEMA'
and to_char(to_date(c.MTIME,'yyyy-mm-dd hh24:mi:ss'),'dd-mm-yyyy') ='&ENTER_DATE'




No comments: