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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MSSQL Rebuild(重建)索引SQLRebuild索引
- oracle ORA-08104處理Oracle
- Rebuild TreeRebuild
- MySQL 5.7使用pt-online-schema-change對大表加索引MySql索引
- flutter中的rebuild一些理解FlutterRebuild
- Online Book Repository
- create index .. onlineIndex
- ERR: node-gyp rebuild No Xcode or CLT version detectedRebuildXCode
- Exchange Online Mailbox RestorationAIREST
- Office Online Server概述Server
- [BUUCTF 2018]Online Tool
- Online Shopping App RequirementsAPPUIREM
- The 2024 CCPC Online Contest
- flutter防止widget rebuild終極解決辦法FlutterRebuild
- Waiting for target device to come onlineAIdev
- [LeetCode] 911. Online ElectionLeetCode
- MySQL Online DDL詳解MySql
- DROP AND RECREATE ONLINE REDOLOG FILES
- The online basketball universe is being redesigned
- Keil中translate,build和rebuild有什麼區別Rebuild
- node與python版本不匹配報錯:node-gyp rebuildPythonRebuild
- mysql之 openark-kit online ddlMySql
- MySQL & MariaDB Online DDL 參考指南MySql
- 2024 ICPC Online 第二場(K)
- How to Convert Class File to Java File Online?Java
- Flink CDC Meetup · Online,5.21 開講!
- PostgreSQL 原始碼解讀(237)- 後臺程式#15(rebuild_database_list)SQL原始碼RebuildDatabase
- 記一次排查Flutter中預期外rebuild的過程FlutterRebuild
- Linux SOCKET介紹 www.weiboke.onlineLinux
- SharePoint Online 自定義Modern UI表單UI
- Online Judge——1000.A+B Problem(c++)C++
- [ABC221D] Online games 題解GAM
- The 2023 ICPC Asia EC Regionals Online Contest (I)
- The 2024 ICPC Asia East Continent Online Contest (I)AST
- 記錄一次 Online DDL 操作
- SharePoint Online 為Modern Page新增指令碼指令碼
- pt-online-schema-change和XtraBackup的
- Python Numpy 切片和索引(高階索引、布林索引、花式索引)Python索引
- 線上改表工具oak-online-alter-table和pt-online-schema-change的使用限制總結