일반 사용자 계정으로 제약사항 목록을 조회하려면 아래 쿼리를 사용하면 됩니다.
select * from user_constraints;
ORA-01157: cannot identify/lock data file (0) | 2015.06.10 |
---|---|
오라클 테이블 전체 한번에 삭제하기 프로시져 (0) | 2015.06.10 |
[오라클/oracle] 테이블 여러개 한꺼번에 삭제하고 싶으면?? (0) | 2015.05.04 |
[오라클/oracle] 오라클에서 테이블 삭제 및 복구하기 (0) | 2015.05.04 |
[Oracle/SQL] instr, substr 을 이용해서 스트링 잘라내기 (0) | 2015.04.20 |
- 외래키 추가하기
MySQL / SQL Server / Oracle / MS Access:
- 외래키 이름 지정해주기
MySQL / SQL Server / Oracle / MS Access:
- 외래키 삭제하기
MySQL:
SQL Server / Oracle / MS Access:
ALTER TABLE Orders[오라클/oracle] Oracle Database Character set 변경(EUC-KR을 UTF8 변경) (0) | 2015.04.20 |
---|---|
[오라클/oracle] select ... for update (0) | 2015.04.20 |
[오라클/SQL] 테이블에 컬럽 추가/삭제 하기 (0) | 2015.04.20 |
[오라클/oracle] Insert 속도 높이기 (0) | 2015.04.20 |
[오라클/oracle] Partitioned Tables and Indexes ( 테이블 및 인덱스 파티션 ) (0) | 2015.04.20 |
ALTER TABLE [DB명] MODIFY([컬럼명] NOT NULL);
간단하다!!!!!!!!!!
화이팅!!!
[ORA-02270] no matching unique or primary key for this column-list (0) | 2015.04.20 |
---|---|
[SQL] Truncate vs Drop vs Delete (0) | 2015.04.20 |
[SQL] 한번에 여러 record(데이타) 삽입하기 (0) | 2015.04.20 |
[SQL] COUNT(*) 와 COUNT(1) (0) | 2015.04.20 |
java.lang.SecurityException: Sealing violation exception (0) | 2015.04.20 |
테이블 백업을 할때에 export / import 를 이용할 수도 있지만 단순하게 rename 명령어를 이용할 수도 있습니다. 또한 create ~ as select ~ 를 이용할 수도 있습니다.
하지만 오늘은 테이블 명을 변경하고 새로 테이블을 생성함으로써 백업을 할 수 있는 방법을 소개하도록 하겠습니다. 참고로 이 방법은 blob데이타가 많은 경우에 상당히 유용합니다.
Step by Step
1) Query table name and index names linked to the table you want to backup
2) Rename table name
3) Rename indexes' name ( if specified explicitly when it is created )
4) Rename constraints' name ( if specified explicitly when it is created )
4) Use the same DDL used to create the renamed table
※ This way is very simple and fast then using "create table ~ as select * from ~" statement when the table has a huge blob data.
1) 변경하고자하는 테이블에 어떤 인덱스들이 있는지 조회합니다.
SQL > select index_name, table_name from user_indexes;
2) 테이블명을 변경합니다.
SQL > rename old_table to new_table;
3) 인덱스명을 변경합니다. ( 인덱스명이 자동생성된 것이 아닌 경우에만 )
SQL > alter index pk_old_table rename to pk_new_table;
4) 제약사항명을 변경합니다. ( 제약사항명이 자동생성된 것이 아닌 경우에만 )
SQL > select * from user_cons_columns where table_name='{table_name};
SQL > alter table {table name} rename constraint {constraint name} to {new constraint name}
5) 기존 테이블을 생성했던 DDL을 사용하여 테이블을 새로 생성합니다.
SQL > create table .........
[오라클/oracle11g] dump 함수 (0) | 2015.04.20 |
---|---|
[오라클/oracle11g] 인코딩 문제 (0) | 2015.04.20 |
테이블 제약사항 조회하기 ( Querying constraints of a table ) (0) | 2015.04.14 |
테이블 명 변경하기 ( Renaming Table Name ) (0) | 2015.04.14 |
인덱스 목록 조회 ( Querying Index List ) (0) | 2015.04.14 |