1. 程式人生 > >查詢某張表上所有dml操作的指令碼

查詢某張表上所有dml操作的指令碼

select /*+ ordered use_hash(d) use_hash(c) */
o.kglnahsh hash_value,
sum(c.kglobt13) disk_reads,
sum(c.kglobt14) logical_reads,
sum(c.kglhdexc) executions,
c.kglnaobj sql_text,
c.kglobt03
from
sys.x$kglob o,
sys.x$kgldp d,
sys.x$kglcursor c
where
o.inst_id=userenv('Instance') and
d.inst_id=userenv('Instance') and
c.inst_id=userenv('Instance') and
o.kglnaown=upper('schena_name') and
o.kglnaobj=upper('table_name') and
d.kglrfhdl=o.kglhdadr and
c.kglhdadr=d.kglhdadr
group by c.kglnaobj,o.kglnahsh,c.kglobt03
order by 2 desc
;
/