Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Disable/Enable scripts?
>-----Original Message-----
>From: hamid alavi [mailto:alavihamid_at_gmail.com <mailto:alavihamid_at_gmail.com> ]
>
>actually you can drop primary key with keep index not disable
I was able to disable a primary key with the keep index option.
SQL> select * from v$version ;
BANNER
SQL> create table t (n number constraint t_pk primary key) ; Table créée.
SQL> select 'IDX' as obj, index_name, status
2 from user_indexes
3 where table_name = 'T'
4 union all
5 select 'PK' as obj, constraint_name, status
6 from user_constraints
7 where table_name = 'T' ;
OBJ INDEX_NAME STATUS --- ------------------------------ -------- IDX T_PK VALID PK T_PK ENABLED
SQL> alter table t disable constraint t_pk keep index ; Table modifiée.
SQL> select 'IDX' as obj, index_name, status
2 from user_indexes
3 where table_name = 'T'
4 union all
5 select 'PK' as obj, constraint_name, status
6 from user_constraints
7 where table_name = 'T' ;
OBJ INDEX_NAME STATUS --- ------------------------------ -------- IDX T_PK VALID PK T_PK DISABLED
SQL>
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Dec 23 2004 - 17:27:40 CST
![]() |
![]() |