→ 데이터베이스/ORACLE 관리
[ORACLE] 특정 테이블의 특정 부분 Export하기 Import하기
벅스쭌
2012. 4. 24. 13:59
반응형
OS : WindowsXP
프로그램 및 버전 : ORACLE 11g
※ 주의사항 : 항상백업
1. 작업개요
- 테이블 스페이스 공간을 확보하기 위해 특정테이블을 날려야 한다. 하지만 그 테이블에 있는 특정 데이터는 남기고 싶다.
2. 작업내용
1) 특정테이블의 특정 데이터를 export한다.
2) 특정테이블을 drop한다.
3) 특정테이블을 다시 import한다.
1) 특정테이블의 특정 데이터를 export한다.
c:\> exp userid/pw tables=tablename query='"where query"' file='c:\dump.dmp'
ex) exp scott/tiger tables=numbers query='"where num>10 and num<100"' file='c:\dumpfile\20120424_numbers.dmp'
- 설명 : scott유저로 접속해서 numbers의 테이블 중 num이 10보다 크고 100보다 작은 데이터들을 c:\ dumpfile \ 20120424_number.dmp로 export 하여라.
2) 특정테이블을 drop한다.
sql> drop table tablename;
ex) drop table numbers
3) 특정테이블을 다시 import한다.
c:\> imp userid=userid/pw fromuser=scott touser=scott file='c:\dump.dmp' tables=tablename'
ex) imp userid=scott/tiger fromuser=scott touser=scott file='c:\dumpfile\20120424_numbers.dmp' tables=numbers'
3. 작업결과
참고 :
반응형