ORA-08104 索引online rebuild
請看我在CSDN上的此篇文章,寫的更為詳細:http://blog.csdn.net/jiujiuaiqi/article/details/6907576
select object_id from dba_objects where object_name='NAQ_TRADE_ITEM_TRADENO_IND';
select object_id from dba_objects where object_name='NAQ_TRADE_ITEM_TRADENO_IND';
OBJECT_ID
----------
115225
檢視ind$的建立語句,rdbms/admin/sql.bsq檔案裡
create table ind$ /* index table */
( obj# number not null, /* object number */
/* DO NOT CREATE INDEX ON DATAOBJ# AS IT WILL BE UPDATED IN A SPACE
* TRANSACTION DURING TRUNCATE */
dataobj# number, /* data layer object number */
ts# number not null, /* tablespace number */
file# number not null, /* segment header file number */
block# number not null, /* segment header block number */
bo# number not null, /* object number of base table */
indmethod# number not null, /* object # for cooperative index method */
cols number not null, /* number of columns */
pctfree$ number not null, /* minimum free space percentage in a block */
initrans number not null, /* initial number of transaction */
maxtrans number not null, /* maximum number of transaction */
pctthres$ number, /* iot overflow threshold, null if not iot */
type# number not null, /* what kind of index is this? */
/* normal : 1 */
/* bitmap : 2 */
/* cluster : 3 */
/* iot - top : 4 */
/* iot - nested : 5 */
/* secondary : 6 */
/* ansi : 7 */
/* lob : 8 */
/* cooperative index method : 9 */
flags number not null,
/* mutable flags: anything permanent should go into property */
/* unusable (dls) : 0x01 */
/* analyzed : 0x02 */
/* no logging : 0x04 */
/* index is currently being built : 0x08 */
/* index creation was incomplete : 0x10 */
/* key compression enabled : 0x20 */
/* user-specified stats : 0x40 */
/* secondary index on IOT : 0x80 */
/* index is being online built : 0x100 */
/* index is being online rebuilt : 0x200 */
/* index is disabled : 0x400 */
/* global stats : 0x800 */
/* fake index(internal) : 0x1000 */
/* index on UROWID column(s) : 0x2000 */
/* index with large key : 0x4000 */
/* move partitioned rows in base table : 0x8000 */
/* index usage monitoring enabled : 0x10000 */
/* 4 bits reserved for bitmap index version : 0x1E0000 */
property number not null, /* immutable flags for life of the index */
/* unique : 0x01 */
/* partitioned : 0x02 */
/* reverse : 0x04 */
/* compressed : 0x08 */
/* functional : 0x10 */
/* temporary table index: 0x20 */
/* session-specific temporary table index: 0x40 */
/* index on embedded adt: 0x80 */
/* user said to check max length at runtime: 0x0100 */
/* domain index on IOT: 0x0200 */
/* join index : 0x0400 */
/* functional index expr contains a PL/SQL function : 0x0800 */
/* The index was created by a constraint : 0x1000 */
/* The index was created by create MV : 0x2000 */
online建立前:
select flags from ind$ where obj#=115225;
----------
115225
檢視ind$的建立語句,rdbms/admin/sql.bsq檔案裡
create table ind$ /* index table */
( obj# number not null, /* object number */
/* DO NOT CREATE INDEX ON DATAOBJ# AS IT WILL BE UPDATED IN A SPACE
* TRANSACTION DURING TRUNCATE */
dataobj# number, /* data layer object number */
ts# number not null, /* tablespace number */
file# number not null, /* segment header file number */
block# number not null, /* segment header block number */
bo# number not null, /* object number of base table */
indmethod# number not null, /* object # for cooperative index method */
cols number not null, /* number of columns */
pctfree$ number not null, /* minimum free space percentage in a block */
initrans number not null, /* initial number of transaction */
maxtrans number not null, /* maximum number of transaction */
pctthres$ number, /* iot overflow threshold, null if not iot */
type# number not null, /* what kind of index is this? */
/* normal : 1 */
/* bitmap : 2 */
/* cluster : 3 */
/* iot - top : 4 */
/* iot - nested : 5 */
/* secondary : 6 */
/* ansi : 7 */
/* lob : 8 */
/* cooperative index method : 9 */
flags number not null,
/* mutable flags: anything permanent should go into property */
/* unusable (dls) : 0x01 */
/* analyzed : 0x02 */
/* no logging : 0x04 */
/* index is currently being built : 0x08 */
/* index creation was incomplete : 0x10 */
/* key compression enabled : 0x20 */
/* user-specified stats : 0x40 */
/* secondary index on IOT : 0x80 */
/* index is being online built : 0x100 */
/* index is being online rebuilt : 0x200 */
/* index is disabled : 0x400 */
/* global stats : 0x800 */
/* fake index(internal) : 0x1000 */
/* index on UROWID column(s) : 0x2000 */
/* index with large key : 0x4000 */
/* move partitioned rows in base table : 0x8000 */
/* index usage monitoring enabled : 0x10000 */
/* 4 bits reserved for bitmap index version : 0x1E0000 */
property number not null, /* immutable flags for life of the index */
/* unique : 0x01 */
/* partitioned : 0x02 */
/* reverse : 0x04 */
/* compressed : 0x08 */
/* functional : 0x10 */
/* temporary table index: 0x20 */
/* session-specific temporary table index: 0x40 */
/* index on embedded adt: 0x80 */
/* user said to check max length at runtime: 0x0100 */
/* domain index on IOT: 0x0200 */
/* join index : 0x0400 */
/* functional index expr contains a PL/SQL function : 0x0800 */
/* The index was created by a constraint : 0x1000 */
/* The index was created by create MV : 0x2000 */
online建立前:
select flags from ind$ where obj#=115225;
FLAGS
----------
2050
這個2050 可以這麼解釋:
2050=2+2048=16進位制的 2+800
檢視ind$的建立語句會知道:
2050代表:2+800=表被分析過(/* analyzed : 0x02 */)+表是被dbms_stats分析的(/* global stats : 0x800 */)
表只有被dbms_stats分析過, global stats的狀態才是yes.
online建立後:
select flags from ind$ where obj#=115225;
select flags from ind$ where obj#=115225;
FLAGS
----------
2562
SELECT 2562-2050 FROM dual;
2562-2050
----------
512
----------
2562
SELECT 2562-2050 FROM dual;
2562-2050
----------
512
增加的512可以這麼解釋:
select to_char(512,'xxxxxx') from dual;
select to_char(512,'xxxxxx') from dual;
TO_CHAR(512,'X
--------------
200
/* index is being online rebuilt : 0x200 */
索引正在被online重建
--------------
200
/* index is being online rebuilt : 0x200 */
索引正在被online重建
kill -9 16522
alter index hades.NAQ_TRADE_ITEM_TRADENO_Ind rebuild online;
ERROR:
ORA-03114: not connected to ORACLE
alter index hades.NAQ_TRADE_ITEM_TRADENO_Ind rebuild online;
ERROR:
ORA-03114: not connected to ORACLE
alter index hades.NAQ_TRADE_ITEM_TRADENO_Ind rebuild online
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 16522
Session ID: 1144 Serial number: 5555
alter index hades.NAQ_TRADE_ITEM_TRADENO_Ind rebuild online;
*
ERROR at line 1:
ORA-08104: this index object 115225 is being online built or rebuilt
DECLARE
RetVal BOOLEAN;
OBJECT_ID BINARY_INTEGER;
WAIT_FOR_LOCK BINARY_INTEGER;
BEGIN
OBJECT_ID := 115225;
WAIT_FOR_LOCK := NULL;
RetVal := SYS.DBMS_REPAIR.ONLINE_INDEX_CLEAN();
COMMIT;
END;
/
但是如果表上存在事務或是有TM鎖,那麼這個PL/SQL塊會久久的HANG在那裡。直到事務結束。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22034023/viewspace-708783/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Online rebuild index遭遇ORA-08104RebuildIndex
- 聊聊索引Index Rebuild和Rebuild Online(下)索引IndexRebuild
- 索引rebuild和rebuild online時要慎重索引Rebuild
- 聊聊索引Index Rebuild和Rebuild Online(上)索引IndexRebuild
- 索引rebuild和rebuild online時要慎重(轉載)索引Rebuild
- rebuild online被終止後的錯誤 ora-08104Rebuild
- rebuild online索引遇到ora-1450Rebuild索引
- 索引rebuild online失敗後處理索引Rebuild
- alter index rebuild 與 rebuild onlineIndexRebuild
- rebuild與rebuild online效率比對Rebuild
- Index Online RebuildIndexRebuild
- oracle10g_alter index rebuild_online_重構索引OracleIndexRebuild索引
- alter index rebuild和rebuild online的區別IndexRebuild
- "Alter index rebuild online parallel n"會修改索引的degree屬性IndexRebuildParallel索引
- create index online 與rebuild index onlineIndexRebuild
- create index online 與rebuild index onlineIndexRebuild
- MSSQL Rebuild(重建)索引SQLRebuild索引
- index rebuild online的問題IndexRebuild
- 重建索引index rebuild online vs offline vs index coalesce vs index shrik space索引IndexRebuild
- 【羅玄】從鎖的角度看rebuild index online和rebuild indexRebuildIndex
- alter index ind1 rebuild 和alter index ind1 rebuild onlineIndexRebuild
- 選出需要rebuild的索引Rebuild索引
- alter index rebuild online引發的血案IndexRebuild
- 測試index online rebuild故障記錄IndexRebuild
- alter index ... rebuild online的機制(zt)IndexRebuild
- “rebuild index online hang住" 問題解析RebuildIndex
- rebuild index online和create index online及沒有online的區別RebuildIndex
- ONLINE方式線上重建索引異常中斷後遇到ORA-08104錯誤的處理思路索引
- oracle索引分類rebuild案例集Oracle索引Rebuild
- 索引是如何定期rebuild的(zt)索引Rebuild
- rebuild index online的鎖機制淺析RebuildIndex
- ORA-08104: this index object 93996 is being online built or rebuiltIndexObject996UI
- online rebulid index異常終止遇到ora-08104Index
- rebuild分割槽表分割槽索引的方法Rebuild索引
- 檢查是否存在truncate或者rebuild的索引Rebuild索引
- 關於索引是否該rebuild的問題索引Rebuild
- 加快建立索引(create / rebuild index) 的幾點索引RebuildIndex
- ORA-08104: this index object %s is being online built or rebuilt的處理IndexObjectUI