Oracle/Admin2016. 11. 18. 10:06

 

 

--------------
- PK 변경 절차
--------------

1. 기존 PK disable
-------------------
alter table test.TEST_TABLE disable constraint TEST_TABLE_PK;

 

2. 기존 PK drop
------------------

alter table test.TEST_TABLE drop constraint TEST_TABLE_PK ;


3. 기존 인덱스 drop
-------------------
drop index test.TEST_TABLE_PK ;

 

4. 신규 인덱스 create
----------------------
create index  test.TEST_TABLE_PK ON test.TEST_TABLE (COL1, COL2, COL3, COL4, COL5);

 

5. PK 추가
----------
ALTER TABLE test.TEST_TABLE ADD CONSTRAINT TEST_TABLE_PK PRIMARY KEY (COL1, COL2, COL3, COL4, COL5);

 

Posted by 자수성가한 부자