데이터 Export 와 Import
DB CAFE
thumb_up 추천메뉴 바로가기
- DBA { Oracle DBA 명령어 > DBA 초급 과정 > DBA 고급 과정 }
- 튜닝 { 오라클 튜닝 목록 }
- 모델링 { 데이터 모델링 가이드 }
목차
1 EXPORT[편집]
1.1 EXPORT 옵션[편집]
- userid
- buffer
- file
- grants
- indexes
- rows
- constraints
- compress
- full
- owner
- tables
- tablespaces
- recordlength
- inctype
- record
- parfile
1.1.1 DB전체 백업[편집]
- conventional Path 로 받기
exp system/oracle full=y log=full_log.log file=/home/oracle/full_test001.dmp
- Direct Path 로 받기
exp system/oracle full=y log=full_log.log file=/home/oracle/full_test001.dmp '''direct=y'''
1.1.2 파일 분할 백업[편집]
exp system/oracle full=y
'''file=(/backup/test_001.dmp,\
/backup/test_002.dmp,\
/backup/test_003.dmp,\
/backup/test_004.dmp)\'''
filesize=100M
log=full_log.log direct=y
1.1.3 해당 테이블 스페이스만 백업[편집]
exp system/oracle full=y log=full_log.log file=/home/oracle/full_test001.dmp '''tablespaces=(example,undotbsl)'''
1.1.4 여러 사용자 백업[편집]
exp system/oracle file=/home/oracle/full_test001.dmp '''owner=(scott,tiger)'''
1.1.5 일부 테이블 백업[편집]
- 버퍼 10메가
- Direct Path
exp system/oracle full=y log=full_log.log file=/home/oracle/full_test001.dmp buffer=20140000 direct=y '''tables=(example,undotbsl)'''
1.1.6 일반사용자로 Full Backup[편집]
- 권한확인
SELECT * FROM DBA_ROLE_PRIVS WHERE GRANTEE = 'SCOTT';
- 권한부여
GRANT EXP_FULL_DATABASE TO SCOTT;
- DBA권한을 부여 해도 됨(권장하지 않음)
1.1.7 파라메터를 이용하여 백업[편집]
exp system/oracle '''parfile=para_file.txt'''
- para_file.txt file=/data/test09.dmp full=y direct=y query="where job='xxx' and ... " ....
1.1.8 SQL적용하여 일부데이터만 백업[편집]
- parfile 옵션을 사용하여 파라메터로 사용하면 편리
exp scott/tiger '''query=\"where ename like \'F%\'\"''' tables=emp file =/data/emp.dmp