Rumah  >  Artikel  >  pangkalan data  >  script:获取某张表上所有的DML操作

script:获取某张表上所有的DML操作

WBOY
WBOYasal
2016-06-07 15:28:491036semak imbas

script:获取某张表上所有的DML操作本脚本from 老白的书 1 select /* ordered use_hash(d) use_hash(c) */ 2 c.kglnahsh hash_value, 3 sum(c.kglobt13) disk_reads, 4 sum(c.kglobt14) logical_reads, 5 sum(c.kglhdexc) executions, 6 c.kglnaobj sql_text

script:获取某张表上所有的DML操作 本脚本from 老白的书


1 select /*+ ordered use_hash(d) use_hash(c) */
2 c.kglnahsh hash_value,
3 sum(c.kglobt13) disk_reads,
4 sum(c.kglobt14) logical_reads,
5 sum(c.kglhdexc) executions,
6 c.kglnaobj sql_text
7 from
8 sys.x$kglob o,
9 sys.x$kgldp d,
10 sys.x$kglcursor c
11 where
12 o.inst_id = userenv('Instance') and
13 d.inst_id = userenv('Instance') and
14 c.inst_id = userenv('Instance') and
15 o.kglnaown = upper('hr') and
16 o.kglnaobj = upper('regions') and
17 d.kglrfhdl = o.kglhdadr and
18 c.kglhdadr = d.kglhdadr
19 group by
20 c.kglnaobj,c.kglnahsh
21* order by 3

HASH_VALUE DISK_READS LOGICAL_READS EXECUTIONS SQL_TEXT
---------- ---------- ------------- ---------- ----------------------------------------------------------
2859910006 0 20 1 select * from regions for update
485381962 5 30 1 delete regions where region_id=1
4202984667 11 66 1 select * from regions
1257077165 7 76 1 insert into regions select * from regions

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn