best practice of rebuild your partition table local index online by using: "update indexes"
The following operations support the UPDATE
INDEXES
clause:
ADD
PARTITION
|SUBPARTITION
COALESCE
PARTITION
|SUBPARTITION
DROP
PARTITION
|SUBPARTITION
EXCHANGE
PARTITION
|SUBPARTITION
MERGE
PARTITION
|SUBPARTITION
MOVE
PARTITION
|SUBPARTITION
SPLIT
PARTITION
|SUBPARTITION
TRUNCATE
PARTITION
|SUBPARTITION
SQL> alter table SAPKBW."/BIC/FZSD_C71" move partition "/BIC/FZSD_C710000000123" tablespace PSAPKBWFACT update indexes;
Table altered.
SQL> set linesize 200
SQL> set pagesize 200
SQL> col table_owner for a10
SQL> col table_name for a15
SQL> col partition_name for a25
SQL> col type for a10
SQL> col column_name for a15
SQL> col sub_type for a10
SQL> col tablespace_name for a15
SQL> select a.index_owner,a.index_name,a.partition_name, b.PARTITIONING_TYPE,
2 b.SUBPARTITIONING_TYPE as sub_type, b.LOCALITY, a.status,a.TABLESPACE_NAME,
3 c.COLUMN_NAME as COLUMN_NAME
4 from sys.dba_ind_partitions a, sys.DBA_PART_INDEXES b, sys.DBA_PART_KEY_COLUMNS c
5 where (a.INDEX_NAME=b.INDEX_name and a.INDEX_owner=b.owner) and (a.INDEX_NAME=c.name and a.index_owner=c.owner)
6 and lower(a.index_name) like lower('%/BIC/FZSD_C71~900%')
7 and a.partition_name like '%/BIC/FZSD_C710000000123'
8 /
INDEX_OWNER INDEX_NAME PARTITION_NAME PARTITI SUB_TYPE LOCALI STATUS TABLESPACE_NAME COLUMN_NAME
------------------------------ ------------------------------ ------------------------- ------- ---------- ------ -------- --------------- ---------------
SAPKBW /BIC/FZSD_C71~900 /BIC/FZSD_C710000000123 RANGE NONE LOCAL USABLE PSAPKBWFACT KEY_ZSD_C71P
if you forget, here is the make-up plan:
1.
----------- -------------------- -------------------- -------------------- ------- ---------- ------ -------- --------------- -------------
SAPKBW /BIC/FZSD_C71~900 /BIC/FZSD_C71 /BIC/FZSD_C710000000 RANGE NONE LOCAL USABLE PSAPKBWFACT KEY_ZSD_C71P
123
2.
SQL> alter table SAPKBW."/BIC/FZSD_C71" move partition "/BIC/FZSD_C710000000123" tablespace PSAPKBWFACT ;
3.
SQL> host kla partidx /BIC/FZSD_C71~900
INDEX_OWNER INDEX_NAME TABLE_NAME PARTITION_NAME PARTITI SUB_TYPE LOCALI STATUS TABLESPACE_NAME COLUMN_NAME
----------- -------------------- -------------------- -------------------- ------- ---------- ------ -------- --------------- -------------
SAPKBW /BIC/FZSD_C71~900 /BIC/FZSD_C71 /BIC/FZSD_C710000000 RANGE NONE LOCAL UNUSABLE PSAPKBWFACT KEY_ZSD_C71P
123
4.
SQL> ALTER TABLE sapkbw."/BIC/FZSD_C71"
MODIFY PARTITION "/BIC/FZSD_C710000000123" REBUILD UNUSABLE LOCAL INDEXES; 2
Table altered.
or
SQL> alter index sapkbw."/BIC/FZSD_C71~900" rebuild partition "/BIC/FZSD_C710000000166" PARALLEL (DEGREE 2) online;
Index altered.
5.
SQL> select a.index_owner,a.index_name,a.partition_name, b.PARTITIONING_TYPE,
2 b.SUBPARTITIONING_TYPE as sub_type, b.LOCALITY, a.status,a.TABLESPACE_NAME,
3 c.COLUMN_NAME as COLUMN_NAME
4 from sys.dba_ind_partitions a, sys.DBA_PART_INDEXES b, sys.DBA_PART_KEY_COLUMNS c
5 where (a.INDEX_NAME=b.INDEX_name and a.INDEX_owner=b.owner) and (a.INDEX_NAME=c.name and a.index_owner=c.owner)
6 and lower(a.index_name) like lower('%/BIC/FZSD_C71~900%')
7 and a.partition_name like '%/BIC/FZSD_C710000000123%'
8 /
INDEX_OWNER INDEX_NAME PARTITION_NAME PARTITI SUB_TYPE LOCALI STATUS TABLESPACE_NAME COLUMN_NAME
------------------------------ ------------------------------ ------------------------- ------- ---------- ------ -------- --------------- ---------------
SAPKBW /BIC/FZSD_C71~900 /BIC/FZSD_C710000000123 RANGE NONE LOCAL USABLE PSAPKBWFACT KEY_ZSD_C71P
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/67/viewspace-982554/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- partition table and partition indexIndex
- Index Online RebuildIndexRebuild
- alter index rebuild 與 rebuild onlineIndexRebuild
- create index online 與rebuild index onlineIndexRebuild
- create index online 與rebuild index onlineIndexRebuild
- 聊聊索引Index Rebuild和Rebuild Online(下)索引IndexRebuild
- 聊聊索引Index Rebuild和Rebuild Online(上)索引IndexRebuild
- alter index rebuild和rebuild online的區別IndexRebuild
- create a partition table using a exsit table
- 【羅玄】從鎖的角度看rebuild index online和rebuild indexRebuildIndex
- index rebuild online的問題IndexRebuild
- alter index ind1 rebuild 和alter index ind1 rebuild onlineIndexRebuild
- alter table using indexIndex
- Rebuild IndexesRebuildIndex
- partition table update partition-key result in changing tablespace
- update global indexes的online的程度研究Index
- rebuild index online和create index online及沒有online的區別RebuildIndex
- Best Practice in Writing
- alter index rebuild online引發的血案IndexRebuild
- 測試index online rebuild故障記錄IndexRebuild
- alter index ... rebuild online的機制(zt)IndexRebuild
- “rebuild index online hang住" 問題解析RebuildIndex
- 關於rebuild index online 及drop index後重建問題RebuildIndex
- Some indexes or index partitions of table have been marked unusableIndex
- rebuild index online的鎖機制淺析RebuildIndex
- Online rebuild index遭遇ORA-08104RebuildIndex
- Local Partitioned IndexesIndex
- 重建索引index rebuild online vs offline vs index coalesce vs index shrik space索引IndexRebuild
- rebuild indexRebuildIndex
- index rebuildIndexRebuild
- INDEX REBUILD和INDEX REORGANIZE和UPDATE STATISTICS是否涉及Sch-M的案例分析IndexRebuild
- css best practice for big team and projectCSSProject
- 關於move table和rebuild index批量操作的記錄RebuildIndex
- oracle10g_alter index rebuild_online_重構索引OracleIndexRebuild索引
- (轉)Index Rebuild Online 過程(9i)完整版IndexRebuild
- rebuild index 排序RebuildIndex排序
- sybase rebuild indexRebuildIndex
- rebuild與rebuild online效率比對Rebuild