對於DML操作來說
SQL> connect scott/tiger@conner
Connected to Oracle
Connected as scott
SQL> select index_name from user_indexes;
INDEX_NAME
PK_DEPT
PK_EMP
開始監視pk_dept索引:
SQL> alter index pk_dept monitoring usage;
Index altered
在此過程中
SQL> select * from dept where deptno=
DEPTNO DNAME LOC
停止監視:
SQL> alter index pk_dept nomonitoring usage;
Index altered
查詢索引使用情況
SQL> select * from v$object_usage;
INDEX_NAME TABLE_NAME MONITORING USED START_MONITORING END_MONITORING
PK_DEPT DEPT NO YES
SQL>
在
不會給出任何錯誤信息
以下這條簡單的語句可以輕易再現這個問題:
如果你有了足夠好的備份(嚴重警告
[oracle@jumper oradata]$ sqlplus
SQL*Plus: Release
Copyright (c)
Connected to:
Oracle
With the Partitioning option
JServer Release
SQL> alter index SYS
Index altered
SQL> shutdown immediate;
Database closed
Database dismounted
ORACLE instance shut down
SQL> startup
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted
此時
[oracle@jumper bdump]$ tail
然後數據庫將會停在此處
如果不知道此bug存在
現在你能做的就是從備份中恢復
[oracle@jumper oradata]$ rm
SQL*Plus: Release
Copyright (c)
Connected to an idle instance
SQL> startup
ORACLE instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted
Database opened
SQL>
Oracle的說法是
稍微研究了一下
v$object_usage是基於以下基表建立起來的:
create or replace view v$object_usage(index_name
注意到v$object_usage關鍵信息來源於OBJECT_USAGE表
另外我們可以注意一下
所以以不同用戶登錄
SQL> select * from v$object_usage;
INDEX_NAME TABLE_NAME MON USE START_MONITORING END_MONITORING
PK_DEPT DEPT NO YES
SQL> select * from object_usage;
select * from object_usage
*
ERROR at line
ORA
SQL> connect /as sysdba
Connected
SQL> /
OBJ# FLAGS START_MONITORING END_MONITORING
實際上我們清除了object_usage表的記錄
SQL> delete from object_usage;
SQL> commit;
Commit complete
SQL> select * from v$object_usage;
no rows selected
此操作對數據庫沒有潛在的影響
From:http://tw.wingwit.com/Article/program/Oracle/201311/17979.html