원문 : http://www.ischo.net -- 조인상 // 시스템 엔지니어

Writer : http://www.ischo.net -- ischo // System Engineer in Replubic Of Korea

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

본문 : http://www.ischo.net -- 조인상 //시스템 엔지니어

+++++++++++++++++++++++++++++++++++++++++++++++++++++++


INCREMENTAL, CUMULATIVE, COMPLETE EXPORT & IMPORT | ORACLE 2005/08/26 16:50 


http://blog.naver.com/jaebeom/100016554671


No. 11528

INCREMENTAL, CUMULATIVE, COMPLETE EXPORT & IMPORT
=================================================


Purpose
-------
'Incremental', 'Cumulative', 'Complete' Export가 무엇이며, 어떻게
효과적인 backup 전략으로 사용할 수 있는지를 알아본다.


Explanation
-----------

1. Incremental, Cumulative export의 계획 수립

'Complete' export는 db 내의 모든 정보를 추출하여 기록해 준다. 따라서,
매일 밤에 complete export를 수행한다면 하루치 이상의 data가 유실될
염려는 전혀 없게 된다.

그러나, complete export는 많은 시간이 소요될 뿐 아니라 많은 space도
필요로 하게 된다. 최종 export 이후에 변경된 정보들에 대해서만 자주 export할
수 있는 방법으로 incremental, cumulative export가 있는데 이를 이용하면
시간과 space를 절약할 수도 있다.

incremental export는 마지막으로 수행된 incremental, cumulative,
complete export 이후에 변경된 모든 table들을 export한다. cumulative
export는 마지막으로 수행된 cumulative, complete export 이후에 변경된 
모든 table들을 export한다.

만약 db가 손상되거나 완전히 유실되었다고 가정한다면,

  1) 가장 최근의 complete export를 import하고
  2) 위의 complete export 이후에 생성된 cumulative export들을 차례로
    import한 후
  3) 위에서 적용한 마지막 cumulative export 이후의 모든 incremental
    export를 적용함으로써

마지막 export 시점까지의 복구가 가능해진다.

다음과 같은 export 실행 계획을 수립한다고 가정해 본다.

  . 매일 밤 incremental export를 수행한다.
  . 매주 cumulative export를 수행한다.
  . 매월 complete export를 수행한다.

이에 따른 한달 계획은 다음과 같을 수 있다.

    일    월    화    수    목      금    토
  +--------+--------+--------+--------+--------+--------+--------+
  |      | Full  | Inc  | Inc  | Inc  | Cum  |      |
  |      |      |      |      |      |      |      |
  |      |    1 |    2 |    3 |    4 |    5 |    6 |
  +--------+--------+--------+--------+--------+--------+--------+
  |      | Inc  | Inc  | Inc  | Inc  | Cum  |      |
  |      |      |      |      |      |      |      |
  |    7 |    8 |    9 |    10 |    11 |    12 |    13 |
  +--------+--------+--------+--------+--------+--------+--------+
  |      | Inc  | Inc  | Inc  | Inc  | Cum  |      |
  |      |      |      |      |      |      |      |
  |    14 |    15 |    16 |    17 |    18 |    19 |    20 |
  +--------+--------+--------+--------+--------+--------+--------+
  |      | Inc  | Inc  | Inc  | Inc  | Cum  |      |
  |      |      |      |      |      |      |      |
  |    21 |    22 |    23 |    24 |    25 |    26 |    27 |
  +--------+--------+--------+--------+--------+--------+--------+

매주 금요일에 cumulative export를 받고 나서는 그 주의 incremental은
더 이상 필요가 없으므로 삭제를 해도 된다. 마찬가지로 월 초에 export를
받은 후에는 지난 달의 incremental, cumulative export는 삭제해도 된다.

만약 오늘이 17일이고 db가 완전히 유실되었다고 가정해 보자. 다음과 같은
절차로 복구할 수 있을 것이다.

  1) db를 새로 생성한다.

  2) system table들에서 가장 최근의 data들을 가져오기 위해서, 가장
    최근의 export file을 이용하여 SYSTEM import(INCTYPE=SYSTEM)을
    수행한다.
    (예에서는 16일자 incremental export)

  3) 가장 최근의 complete export file을 이용하여 RESTORE import
    (INCTYPE=RESTORE)를 수행한다.(예에서는 1일자 complete export)

  4) 위의 complete export 이후의 모든 cumulative export file을 이용하여
    RESTORE import를 수행한다.(예에서는 5일, 12일의 cumulative export)

  5) 마지막 cumulative export 이후의 모든 incremental export file을
    이용하여 RESTORE import를 수행한다.(예에서는 15일, 16일의
    incremental export)

가장 최근의 export file은 복구 작업의 시작과(INCTYPE=SYSTEM) 마지막에
(INCTYPE=RESTORE) 각각 다른 INCTYPE으로 import된다는 사실에 주목한다.


2. incremental, cumulative export 시 export되는 정보들

  1) 모든 system object들 (tablespace, rollback segment, user privilege
    등을 포함, temporary segment는 제외)

  2) drop된 object에 대한 정보

  3) 마지막 export 이후에 생성된 cluster, table, view, sysnonym 등

  4) 변경(update, insert, delete 등)이 발생한 모든 table들


3. COMMAND SYNTAX

export :
  exp username/password inctype=complete
  or exp username/password inctype=cumulative
  or exp username/password inctype=incremental

import :

  imp username/password inctype=system

  가장 최근의 export file에서 system data를 import할 때 사용한다.
  (실제 user data를 restore import하기 전에 반드시 수행해야 함)

  or imp username/password inctype=restore


Example
-------

위의 일정표에 의거하여 수행한 예이다.

  일자    command
  ---------------------------------------------------------------
  1  월  exp system/manager inctype=complete  file=base.dmp
  2  화  exp system/manager inctype=incremental file=inc1
  3  수  exp system/manager inctype=incremental file=inc2
  4  목  exp system/manager inctype=incremental file=inc3
  5  금  exp system/manager inctype=comulative  file=cum1
        (inc1, inc2, inc3는 이 시점에 삭제해도 무방하다.)

  8  월  exp system/manager inctype=incremental file=inc4
  9  화  exp system/manager inctype=incremental file=inc5
  10 수  exp system/manager inctype=incremental file=inc6
  11 목  exp system/manager inctype=incremental file=inc7
  12 금  exp system/manager inctype=comulative  file=cum2
        (inc4, inc5, inc6, inc7은 이시점에 삭제해도 무방)

  15 월  exp system/manager inctype=incremental file=inc8
  16 화  exp system/manager inctype=incremental file=inc9
  17 수  db 유실됨. 다음과 같이 복구함.

        imp system/manager inctype=system  full=y file=inc9
        imp system/manager inctype=restore full=y file=base.dmp
        imp system/manager inctype=restore full=y file=cum1
        imp system/manager inctype=restore full=y file=cum2
        imp system/manager inctype=restore full=y file=inc8
        imp system/manager inctype=restore full=y file=inc9


Reference Documents
-------------------
Oracle Utilities Guide

출처:한국오라클
번호 제목 글쓴이 날짜 조회 수
55 캐릭터셋 확인하는 쿼리 조인상 2010.05.12 8121
54 v$datafile 의 status 에 recover로 표시되는 경우 조인상 2010.05.12 9941
53 NT기반 오라클환경에서 OS 다시 깔았을때 복구방법 조인상 2010.05.12 9138
52 AIO 문제때문에 오라클 실행안될때 조인상 2010.05.12 9664
51 제약조건 이름은 아는데 테이블을 모를경우 찾는 스크립트 조인상 2010.05.12 8448
50 오라클 온라인백업스크립트 구성 예 조인상 2010.05.12 7442
49 Oracle Library Cache and Dictionary Cache 조인상 2010.05.12 8845
48 오라클 인덱스 분리해서 임포트 하는 방법 조인상 2010.05.12 6643
47 오라클 hotbackup 스크립트 조인상 2010.05.12 9582
46 오라클 삭제하는 방법 조인상 2010.05.12 14078
45 AIX 64bit - oracle 10.2.0.1 설치 file 조인상 2010.05.12 12745
44 오라클 홈디렉토리 변경 ( /oracle_backup => /oracle ) 조인상 2010.05.12 11917
43 Linux 32bit ( EntePrise AS 3.0) - 오라클 9.2.0.4 설치 조인상 2010.05.12 7326
» INCREMENTAL, CUMULATIVE, COMPLETE EXPORT & IMPORT 조인상 2010.05.12 7144
41 오라클 cold 백업 스크립트(특정데이터파일만 추출) NT용 file 조인상 2010.05.12 9221
40 TNS-12540: TNS:internal limit restriction exceeded 조인상 2010.05.12 9299
39 테이블 컬럼의 데이터타입 변경 조인상 2010.05.12 14397
38 테이블의 특정 컬럼에 걸려있는 제약 조건의 확인 조인상 2010.05.12 7978
37 테이블 복구 사례 조인상 2010.05.12 6814
36 Oracle Flashback 복구 조인상 2010.05.12 7985
서버에 요청 중입니다. 잠시만 기다려 주십시오...