RE: Disable/Enable scripts?

>-----Original Message-----
>From: hamid alavi [mailto:alavihamid@xxxxxxxxx <mailto:alavihamid@xxxxxxxxx> ]
>
>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

Other related posts: