热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

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

script:获取某张表上所有的DML操作本脚本from老白的书1select*ordereduse_hash(d)use_hash(c)*2c.kglnahshhash_value,3sum(c.kglobt13)disk_reads,4sum(c.kglobt14)logical_reads,5sum(c.kglhdexc)executions,6c.kglnaobjsql_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

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


推荐阅读
author-avatar
jackystorm岁月_657
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有