Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Disable/Enable scripts?

RE: Disable/Enable scripts?

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Thu, 23 Dec 2004 15:32:23 -0800
Message-ID: <B5C5F99D765BB744B54FFDF35F60262109F87BAA@irvmbxw02>


>-----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



Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for 32-bit Windows: Version 9.2.0.4.0 - Production NLSRTL Version 9.2.0.4.0 - Production

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-l
Received on Thu Dec 23 2004 - 17:27:40 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US