Databases Reference
In-Depth Information
You can specify the update indexes clause with any of the preceding partition maintenance
operations. In case you're using a global partitioned index, you can specify the update global indexes
clause to prevent the global index from being marked as unusable. The two big advantages in specifying
the update global indexes clause is that the index remains online and available during the maintenance
operation and you don't have to rebuild it after the maintenance operation.
You specify the update global indexes clause in order to automatically maintain a global index
during a DDL operation. You can specify the update global indexes clause only for adding a partition to
a hash partitioned table or a subpartition to a hash partitioned table. You can't specify it for adding
partitions to a range partitioned table. Here's an example that shows how to specify the clause when
performing a table maintenance operation on a hash partitioned table:
SQL> create table emp_hpart(
2 empno number(4) not null,
3 ename varchar2(10),
4 sal number(7,2))
5 partition by hash(sal)
6* (partition H1, partition H2, partition H3, partition H4)
SQL> /
Table created.
SQL> create index emp_global_HASH_idx on emp_hpart(ename)
2 global partition by range (ename)
3 (partition p1 values less than ('N') ,
4* partition p2 values less than (maxvalue))
SQL> /
Index created.
SQL> insert into emp_hpart values (1,'AAA',100);
1 row created.
SQL> commit;
Commit complete.
SQL> alter table emp_hpart add partition q5
2* update global indexes
SQL> /
Table altered.
SQL>
SQL> select substr(index_name,1,20) index_name, substr(partition_name,1,20)
2 part_name , status
3 from dba_ind_partitions
4* where index_name= 'EMP_GLOBAL_HASH_IDX' order by partition_name
SQL> /
Search WWH ::




Custom Search