首页 > 数据库 > mysql教程 > script:获取某张表上所有的DML操作

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

WBOY
发布: 2016-06-07 15:28:49
原创
1065 人浏览过

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

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板