1.在10.2.0.5之前monitoring会受dbms_stats收集统计信息的时候cascade=>TRUE的影响,即如果收集表的统计信息的时候cascade=>TRUE,会一起收集索引的统计信息,那么Oracle会任务该索引被使用了,在10.2.0.5之后,bug 6798910 进行修复
2.在11.2.0.3的时候,对索引开启了monitoring之后,如果重建索引,那么monitoring会关闭,需要打patch 16311211进行修复
3.一般是只用执行alter index *** monitoring usage语句的用户,才能select到v$object_usage视图中的内容
这是由于这个视图的创建语句决定的:
SQL> select text from dba_views where view_name ='V$OBJECT_USAGE';
TEXT
select io.name, t.name,
decode(bitand(i.flags, 65536), 0, 'NO', 'YES'),
decode(bitand(ou.flags, 1), 0, 'NO', 'YES'),
ou.start_monitoring,
ou.end_monitoring
from sys.obj$ io, sys.obj$ t, sys.ind$ i, sys.object_usage ou
where io.owner# = userenv('SCHEMAID')
and i.obj# = ou.obj#
and io.obj# = ou.obj#
and t.obj# = i.bo#
可以自行创建一个视图来解决
SQL> create or replace view ALL_OBJECT_USAGE
(OWNER,
INDEX_NAME,
TABLE_NAME,
MONITORING,
USED,
START_MONITORING,
END_MONITORING)
as
select u.name, io.name, t.name,
decode(bitand(i.flags, 65536), 0, 'NO', 'YES'),
decode(bitand(ou.flags, 1), 0, 'NO', 'YES'),
ou.start_monitoring,
ou.end_monitoring
from sys.user$ u, sys.obj$ io, sys.obj$ t, sys.ind$ i, sys.object_usage ou
where i.obj# = ou.obj#
and io.obj# = ou.obj#
and t.obj# = i.bo#
and u.user# = io.owner#;
阅读(1371) | 评论(0) | 转发(0) |