하은양 믿음군 효실맘 호홍홍집s

Oracle expdp에서 impdp까지의 전체 작업 본문

가벼운 배움/Oracle

Oracle expdp에서 impdp까지의 전체 작업

호홍홍집 2015. 10. 22. 13:39

전체 작업과정을 하나로 보자

1. Export

expdp parfile=rest_exp_20151022.par;

rest_exp_20151022.par 내용 :
USERID=REST/GJRESTPWD
DUMPFILE=REST_20151022_%U.DMP
LOGFILE=REST_20151022.LOG
SCHEMAS=REST

여기에 저장됨 : /oracle/app/oracle/admin/ORCL/dpdump/REST_20151022_01.DMP

2. dump 파일 이동

scp /oracle/app/oracle/admin/ORCL/dpdump/*.* root@xxx.xxx.xxx.xxx:/oracle/app/oracle/admin/ORCL/dpdump/

복사파일 : chown oracle:dba *  적용

3. Tablespace 생성

SELECT TABLESPACE_NAME, STATUS, CONTENTS FROM DBA_TABLESPACES;

CREATE TABLESPACE TSN_REST
    DATAFILE '/oradata/ORCL/TSN_REST' SIZE 200M AUTOEXTEND ON
    NEXT 10M MAXSIZE UNLIMITED
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;

CREATE TEMPORARY TABLESPACE TSN_REST_TEMP
   TEMPFILE '/oracle/ORCL/TSN_REST_TEMP' SIZE 100M AUTOEXTEND ON
   NEXT 10M MAXSIZE UNLIMITED
TABLESPACE GROUP ''
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10M;

4. User 생성

CREATE USER REST IDENTIFIED BY <비밀번호>
DEFAULT TABLESPACE TSN_REST
TEMPORARY TABLESPACE TSN_REST_TEMP PROFILE DEFAULT ACCOUNT UNLOCK;
GRANT CONNECT TO REST WITH ADMIN OPTION;
GRANT DBA TO REST WITH ADMIN OPTION;
GRANT RESOURCE TO REST WITH ADMIN OPTION;
ALTER USER REST DEFAULT ROLE ALL;
GRANT UNLIMITED TABLESPACE TO REST WITH ADMIN OPTION;
ALTER USER REST QUOTA UNLIMITED ON TSN_REST;

5. Import

impdp system/manager parfile=REST_imp.par

REST_imp.par 내용 :
DUMPFILE=REST_20151022_01.DMP
LOGFILE=REST_20151022.LOG
SCHEMAS=REST