원문 : 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 Opatch : 다재다능한 패치 관리 유틸리티 file 조인상 2010.05.12 10323
54 Unix/Linux 에서 exp 동시에 gzip 으로 압축하기 조인상 2011.06.10 10198
53 datafile 위치 변경하는 방법 조인상 2010.05.12 10091
52 v$datafile 의 status 에 recover로 표시되는 경우 조인상 2010.05.12 9941
51 BUFFER HIT RATIO NOTES 조인상 2010.06.15 9938
50 [장애처리] 메모리 풀로 인한 OS hang-up 조인상 2010.05.12 9769
49 Aix 5L에서 오라클9i 설치법 조인상 2010.05.12 9708
48 AIO 문제때문에 오라클 실행안될때 조인상 2010.05.12 9664
47 오라클 hotbackup 스크립트 조인상 2010.05.12 9582
46 오라클 8.1.7 for windows [5] file 조인상 2010.07.01 9351
45 TNS-12540: TNS:internal limit restriction exceeded 조인상 2010.05.12 9299
44 오라클 cold 백업 스크립트(특정데이터파일만 추출) NT용 file 조인상 2010.05.12 9221
43 NT기반 오라클환경에서 OS 다시 깔았을때 복구방법 조인상 2010.05.12 9138
42 Oracle expdp 로 백업하기 조인상 2015.02.23 9094
41 SGA 크기를 결정하는 방법 조인상 2010.05.12 8948
40 Oracle Library Cache and Dictionary Cache 조인상 2010.05.12 8845
39 레드햇리눅스9에 오라클9i설치중 hang 조인상 2010.05.12 8788
38 제약조건 이름은 아는데 테이블을 모를경우 찾는 스크립트 조인상 2010.05.12 8448
37 ORA-01632 조인상 2010.05.13 8437
36 처음 오라클 설치시 SGA 영역크기 정하는 규칙 조인상 2010.05.12 8345
서버에 요청 중입니다. 잠시만 기다려 주십시오...