Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Question about Append hint in Insert
> you can disable the constraint without the need to drop the index;
You may also do that with an index created as part of the primary key
constraint:
11:47:28 SQL>drop table x;
Table dropped.
11:47:28 SQL> 11:47:28 SQL>create table x 11:47:28 2 as 11:47:28 3 select distinct object_name 11:47:28 4 from user_objects 11:47:28 5 /
Table created.
11:47:28 SQL> 11:47:28 SQL>alter table x add constraint x_pk 11:47:28 2 primary key(object_name) 11:47:28 3 /
Table altered.
11:47:28 SQL> 11:47:28 SQL>select index_name , uniqueness, status 11:47:28 2 from user_indexes 11:47:28 3 where table_name = 'X' 11:47:28 4 / INDEX NAME UNIQUENES STATUS ------------------------------ --------- -------- X_PK UNIQUE VALID
1 row selected.
11:47:28 SQL> 11:47:28 SQL>select constraint_name, constraint_type, status 11:47:28 2 from user_constraints 11:47:28 3 where table_name = 'X' 11:47:28 4 / CONSTRAINT_NAME C STATUS ------------------------------ - -------- X_PK P ENABLED
1 row selected.
11:47:28 SQL>
11:47:28 SQL>alter table x disable primary key keep index;
Table altered.
11:47:28 SQL> 11:47:28 SQL>select index_name , uniqueness, status 11:47:28 2 from user_indexes 11:47:28 3 where table_name = 'X' 11:47:28 4 / INDEX NAME UNIQUENES STATUS ------------------------------ --------- -------- X_PK UNIQUE VALID
1 row selected.
11:47:28 SQL> 11:47:28 SQL>select constraint_name, constraint_type, status 11:47:28 2 from user_constraints 11:47:28 3 where table_name = 'X' 11:47:28 4 / CONSTRAINT_NAME C STATUS ------------------------------ - -------- X_PK P DISABLED
1 row selected.
11:47:28 SQL>
-- 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 Mon Jun 21 2004 - 13:45:07 CDT
![]() |
![]() |