设为首页 加入收藏

TOP

关于生产库上索引碎片收集的问题
2014-11-24 14:16:08 】 浏览:874
Tags:关于 生产 索引 碎片 收集 问题
关于生产库上索引碎片收集的问题
问题描述:
环境:oracle10.2.0.5 RAC+HP-UX
用analyze index validate structure这个语句可以验证索引的碎片程度,然后通过index_stats视图来查询,请问这个语句在生产库上对于比较大的索引使用这个语句,对系统的影响有多大? www.2cto.com
FYI:
analyze index validate structure
SQL> create table ttab(t1 int);
Table created.
SQL> create index ind_tab on ttab(t1);
Index created.
SQL> oradebug setmypid
Statement processed.
SQL> oradebug event 10704 trace name context forever,level 10;
Statement processed.
SQL> analyze index ind_tab validate structure;
Index analyzed.
SQL> oradebug tracefile_name
/s01/admin/G10R25/udump/g10r25_ora_25784.trc
[root@vrh8 ~]# grep "ksqgtl \*\*\*" /s01/admin/G10R25/udump/g10r25_ora_25784.trc
ksqgtl *** TX-00030007-000071e6 mode=6 flags=0x401 timeout=0 ***
ksqgtl *** TM-00010183-00000000 mode=4 flags=0x401 timeout=0 ***
analyze index validate structure 要在table上加 TM mode=4的share lock,会block dml
second:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> oradebug setmypid
Statement processed.
SQL> oradebug event 10704 trace name context forever,level 10;
Statement processed.
SQL> analyze index ind_tab validate structure online;
Index analyzed.
SQL> oradebug tracefile_name
/s01/admin/G10R25/udump/g10r25_ora_25830.trc
[root@vrh8 ~]# grep "ksqgtl \*\*\*" /s01/admin/G10R25/udump/g10r25_ora_25830.trc
ksqgtl *** TX-0009002d-000072d7 mode=6 flags=0x401 timeout=0 ***
SQL> select * from index_stats;
no rows selected
analyze index ind_tab validate structure online ==> 不要求 表上的 share lock,但是不填充index_stats 视图, 所以 validate structure online 只能用来验证索引上是否存在讹误
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Oracle Patch Bundle Update 下一篇AutoTrace执行结果说明

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目