alter index rebuild和rebuild online的區別
SQL> explain plan for
2 alter index test.IND_OBJECT_ID rebuild;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
-------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
-------------------------------------------------------------------------
| 0 | ALTER INDEX STATEMENT | | 6235 | 18705 | 10 |
| 1 | INDEX BUILD NON UNIQUE| IND_OBJECT_ID | | | |
| 2 | SORT CREATE INDEX | | 6235 | 18705 | |
| 3 | INDEX FAST FULL SCAN| IND_OBJECT_ID | 6235 | 18705 | |
-------------------------------------------------------------------------
Note: cpu costing is off
11 rows selected.
SQL> explain plan for
2 alter index test.IND_OBJECT_ID rebuild online;
Explained.
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
-------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
-------------------------------------------------------------------------
| 0 | ALTER INDEX STATEMENT | | 6235 | 18705 | 10 |
| 1 | INDEX BUILD NON UNIQUE| IND_OBJECT_ID | | | |
| 2 | SORT CREATE INDEX | | 6235 | 18705 | |
| 3 | TABLE ACCESS FULL | T | 6235 | 18705 | 10 |
-------------------------------------------------------------------------
Note: cpu costing is off
11 rows selected.
SQL>
可見rebuild 和rebuild online的掃描方式不同,但都會發生sort.
在rebuild online 時會報錯
ORA-08120: Need to create SYS.IND_ONLINE$ table in order to (re)build index
Cause: Alter index Build/Rebuild online require existing of SYS.IND_ONLINE$ table.
Action: User/DBA needs to create sys.ind_online$ before alter the index /rdbms/admin/catcio.sql contains script to create ind_online$.
解決方法就是執行catcio.sql 建立SYS.IND_ONLINE$表
SQL> conn / as sysdba
Connected.
SQL> @D:oracleora92rdbmsadmincatcio
除了掃描方式不同外,rebuild 會阻塞dml語句而rebuild online則不會。
rebuild online時系統會產生一個SYS_JOURNAL_xxx的IOT型別的系統臨時日誌表,所有rebuild online時索引的變化都記錄在這個表中,當新的索引建立完成後,把這個表的記錄維護到新的索引中去,然後drop掉舊的索引,rebuild online就完成了。
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1479533來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-84588/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- alter index rebuild 與 rebuild onlineIndexRebuild
- alter index ind1 rebuild 和alter index ind1 rebuild onlineIndexRebuild
- alter index rebuild online引發的血案IndexRebuild
- alter index ... rebuild online的機制(zt)IndexRebuild
- 聊聊索引Index Rebuild和Rebuild Online(下)索引IndexRebuild
- 聊聊索引Index Rebuild和Rebuild Online(上)索引IndexRebuild
- 【羅玄】從鎖的角度看rebuild index online和rebuild indexRebuildIndex
- rebuild index online和create index online及沒有online的區別RebuildIndex
- Index Online RebuildIndexRebuild
- alter index rebuild與index_statsIndexRebuild
- Oracle alter index rebuild 說明OracleIndexRebuild
- rebuild index 和 recreate index (重新建立index) 的區別RebuildIndex
- create index online 與rebuild index onlineIndexRebuild
- create index online 與rebuild index onlineIndexRebuild
- index rebuild online的問題IndexRebuild
- "Alter index rebuild online parallel n"會修改索引的degree屬性IndexRebuildParallel索引
- oracle10g_alter index rebuild_online_重構索引OracleIndexRebuild索引
- 索引rebuild和rebuild online時要慎重索引Rebuild
- rebuild indexRebuildIndex
- index rebuildIndexRebuild
- 索引rebuild和rebuild online時要慎重(轉載)索引Rebuild
- rebuild index online的鎖機制淺析RebuildIndex
- rebuild與rebuild online效率比對Rebuild
- 測試index online rebuild故障記錄IndexRebuild
- “rebuild index online hang住" 問題解析RebuildIndex
- rebuild index 排序RebuildIndex排序
- sybase rebuild indexRebuildIndex
- Online rebuild index遭遇ORA-08104RebuildIndex
- ORACLE中index的rebuildOracleIndexRebuild
- Index rebuild --case 1IndexRebuild
- 關於rebuild index online 及drop index後重建問題RebuildIndex
- 重建索引index rebuild online vs offline vs index coalesce vs index shrik space索引IndexRebuild
- 【江楓 】Oracle 9i和10g在create index和rebuild index的統計資訊的區別OracleIndexRebuild
- (轉)Index Rebuild Online 過程(9i)完整版IndexRebuild
- 大資料量rebuild index的經歷大資料RebuildIndex
- best practice of rebuild your partition table local index online by using: "update indexes"RebuildIndex
- Keil中translate,build和rebuild有什麼區別Rebuild
- INDEX REBUILD和INDEX REORGANIZE和UPDATE STATISTICS是否涉及Sch-M的案例分析IndexRebuild