Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

0

积分

1

好友

4

主题
1#
发表于 2013-11-6 14:23:31 | 查看: 2540| 回复: 4
索引:
create index test_index on example(object_name) nosegment;


SQL> alter session set "_USE_NOSEGMENT_INDEXES" = true;

Session altered.

SQL>
SQL> alter index test_index monitoring usage;
alter index test_index monitoring usage
*
ERROR at line 1:
ORA-08114: can not alter a fake index


请问,怎么监控这个索引!
2#
发表于 2013-11-6 14:24:54
9.2.0.8
sun 10

回复 只看该作者 道具 举报

3#
发表于 2013-11-6 14:30:30
SQL> select * from v$VERSION;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production


CREATE TABLE virtual_index_tab as SELECT * FROM dba_tables;



CREATE INDEX virtual_index_tab_i ON virtual_index_tab(table_name) NOSEGMENT;


alter index virtual_index_tab_i monitoring usage;

SQL> alter index virtual_index_tab_i monitoring usage;
alter index virtual_index_tab_i monitoring usage
*
ERROR at line 1:
ORA-08114: can not alter a fake index


[oracle@oel8 ~]$ oerr ora 8114
08114, 00000, "can not alter a fake index"
// *Cause:  User attempted to alter a fake index
// *Action: drop fake index


一个fake index是不能被真实使用的 只能被CBO 用来生成执行计划而已, 且无法再实际执行时使用, 所以不存在 usage 使用信息, 所以也就没有monitor usage的必要

回复 只看该作者 道具 举报

4#
发表于 2013-11-6 14:30:45
ODM FINDING;
Fake/NOSEGMENT Indexes

• Sometimes referred to as a Virtual Index

• An index that doesn’t actually exist

• Is not a segment, therefore contains no data

• Is not maintained during table DML

• Is useful to see what effect the index might have if it truly existed

• Can be used by the CBO to generate plan but

is not actually used at run time

回复 只看该作者 道具 举报

5#
发表于 2013-11-8 17:56:26
tks                              

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-6-15 10:30 , Processed in 0.045780 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569