Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Data load ideas
No, after the exchange the indexes are not left in an unusable state.
See example below.
SQL> remark SQL> remark create original table SQL> remark SQL> create table names (id number, name varchar2 (30),2 constraint names_pk primary key (id) using index local) 3 partition by range (id)
SQL> insert into names (id, name) values (50, 'PERCIVAL') ;
1 ligne créée.
SQL> insert into names (id, name) values (160, 'MARION') ;
1 ligne créée.
SQL> commit ;
Validation effectuée.
SQL> remark SQL> remark display data SQL> remark SQL> select * from names ; ID NAMESQL> remark
---------- ------------------------------
50 PERCIVAL 160 MARION SQL> remark SQL> remark create exchange table with enable novalidate constraint
SQL> insert into names_ex (id, name) values (60, 'ARCHIBALD') ;
1 ligne créée.
SQL> commit ;
Validation effectuée.
SQL> remark SQL> remark index on original table is usable SQL> remark SQL> select index_name, partition_name, status2 from user_ind_partitions
INDEX_NAME PARTITION_NAME STATUSSQL> remark
------------------------------ ------------------------------ --------
NAMES_PK NAMES_P2 USABLE NAMES_PK NAMES_P1 USABLE SQL> remark SQL> remark change constraint to novalidate
SQL> remark SQL> remark after novalidate of PK: index on original table is still usable SQL> remark SQL> select index_name, partition_name, status2 from user_ind_partitions
INDEX_NAME PARTITION_NAME STATUS
------------------------------ ------------------------------ --------
NAMES_PK NAMES_P2 USABLE NAMES_PK NAMES_P1 USABLE SQL> remark SQL> remark exchange partition
SQL> remark SQL> remark after exchange: index on original table is still usable SQL> remark SQL> select index_name, partition_name, status2 from user_ind_partitions
INDEX_NAME PARTITION_NAME STATUSSQL> remark
------------------------------ ------------------------------ --------
NAMES_PK NAMES_P2 USABLE NAMES_PK NAMES_P1 USABLE SQL> remark SQL> remark verify that exchange actually happened
ID NAME
---------- ------------------------------
60 ARCHIBALD 160 MARION SQL> remark SQL> remark revalidate constraint (this can happen while table is being used SQL> remark for DML)
-----Original Message-----
From: Paul Baumgartel
Jacques, thanks, you are quite right. Somehow I missed that constraint state. However, after the exchange, the indexes are left in unusable state, and must be rebuilt, no? At least that's what happened when I tried it. That, in turn, is not compatible with keeping the site fully available during the data load operation.
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.htmlReceived on Thu Apr 29 2004 - 14:56:12 CDT
-----------------------------------------------------------------
![]() |
![]() |