■ Export 하는 방법
▣ Full Level Export
- 전체 데이터베이스가 엑스포트 됩니다.
- 모든 테이블스페이스, 모든 사용자, 또한 모든 객체, 데이터들이 포함됩니다.
예제) C:\>exp userid=system/manager file='C:\full.dmp' full=y
▣ User Level Export
- 사용자 객체들이 엑스포트 되고 객체들 안에 있는 데이터도 엑스포트 됩니다.
- 사용자 객체에 대한 모든 권한들과 인덱스들도 엑스포트 됩니다.
- 다른 사용자들의 객체와 권한, 인덱스들은 엑스포트 되지 않습니다.
예제1) 사용자 자신이 만든 모든 오브젝트를 그 user가 EXPORT하는 방법입니다.
C:\>exp userid=scott/tiger file='C:\scott.dmp'
예제2) SYSTEM/MANAGER로 접속한 DBA가 여러 user소유의 오브젝트들을 EXPORT 하는
방법입니다.
C:\>exp userid=system/manager owner=scott file='C:\scottuser.dmp'
▣ Table Level Export
- 명시된 테이블만 엑스포트 됩니다.
- 테이블의 구조, 인덱스, 권한등이 테이블과 함께 엑스포트 됩니다.
예제1) system user로 다른 유저의 table 몇 개만 Export하는 예제입니다.
C:\>exp userid=system/manager file='C:exp.dmp' tables=(scott.EMP, scott.DEPT)
=> 위와 같이 table의 schema(user)명까지 지정해야만 export가 성공합니다.
예제2) scott user로 table 몇 개만 EXPORT하는 예
C:\>exp userid=scott/tiger file='C:\exp.dmp' tables=(EMP, DEPT) log=exp.log
=> user가 자신의 table을 export할 때에는 schema 명을 지정할 필요 없습니다.
■ Import 하는 방법
Import 예제
예제1) 전체 데이터베이스가 IMPORT됩니다. (Full Level)
C:\>imp userid=system/manager file='C:\full.dmp' full=y
예제2) scott의 유저 IMPORT를 실행 합니다.(User Level)
C:\>imp userid=scott/tiger file='C:\scott.dmp'
예제3) 다른 계정으로 IMPORT하기
==> scott유저의 데이터를 EXPORT받아서 test 유저에게 IMPORT하는 예제 입니다.
C:\>exp userid=system/manager file='C:\scott.dmp' owner=scott
C:\>imp userid=system/manager file='C:\scott.dmp' fromuser=scott touser=test
view 가 아닌 table이 대상이 됨
exp userid=safedb/initech@orcl3 file='/safedb/safedb2/plugin_orcl3/exp_safedbtest.dmp' tables=(safedb.safedbtest_enc)
imp userid=safedb/initech@orcl3 file='/safedb/safedb2/plugin_orcl3/exp_safedbtest.dmp' tables=(safedb.safedbtest2)
import는 dba권한
댓글 없음:
댓글 쓰기