Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: pros and cons (now: KEEP INDEX)
Has anyone come up with a reason why you'd want the concept of a KEEP INDEX option? Consider the
scenarios
I'm guessing 'keep' was included for completeness, as the complement to the 'drop index' syntax
Am I missing something obvious? My initial thought was that it would be useful for partition level ops, eg
so that only the single index partition requires work. But that doesn't work for a unique index:
SQL> create table T ( x number, y number, z number )
2 partition by range (x)
3 ( partition p1 values less than (100),
4 partition p2 values less than (200));
Table created.
SQL>
SQL> create unique index T_U on T ( x, y ) local;
Index created.
SQL>
SQL> alter table T add constraint T_UQ unique (x,y);
Table altered.
SQL>
SQL> alter table T disable constraint T_UQ keep index;
Table altered.
SQL>
SQL> alter index T_U modify partition p1 unusable;
Index altered.
SQL>
SQL> alter session set skip_unusable_indexes = true;
Session altered.
SQL>
SQL> insert into T values (1,1,1);
insert into T values (1,1,1)
*
ERROR at line 1:
ORA-01502: index 'PD71986.T_U' or partition of such index is in unusable state
Cheers
Connor
Co-author: "Mastering Oracle PL/SQL - Practical Solutions" - available now web: http://www.oracledba.co.uk web: http://www.oaktable.net
"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Thu Apr 01 2004 - 19:04:29 CST
![]() |
![]() |