원문 : 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

출처:한국오라클
번호 제목 글쓴이 날짜 조회 수
115 checkpoint not complete에 대해서 ischo 2013.05.22 249
114 백업에 관한 조언 조인상 2010.05.12 5184
113 [사이트 소개]오라클 사용자 그룹 조인상 2010.05.12 5707
112 [기타] 디비튜닝에 대한 질문과답변내용... 조인상 2010.05.12 5718
111 필수로 암기해야 할 view 들... 조인상 2010.05.12 5748
110 오라클 재시작시에 롤백세그먼트 OFFLINE 조인상 2010.05.12 5784
109 인텔 펜티엄4 기반 Windows에 설치시 오류에 대해서 조인상 2010.05.12 5795
108 오라클 뷰들... 조인상 2010.05.12 5908
107 OS의 파일사이즈가 2GB로 제한될때 split으로 나누기 조인상 2010.05.12 6189
106 패치 중 OS 문제로 runInstaller가 끊길때 조인상 2010.05.12 6429
105 OPATCH(V9.2) 기능 및 사용가이드 조인상 2010.05.12 6577
104 오라클 인덱스 분리해서 임포트 하는 방법 조인상 2010.05.12 6643
103 OPN 가입시의 장점 file 조인상 2010.05.12 6721
102 OS재설치 후 오라클 복구(솔라리스) 조인상 2010.05.12 6779
101 테이블 복구 사례 조인상 2010.05.12 6814
100 오라클 8.1.7 -> 7.3.4 로 DB data 이전 조인상 2010.05.12 6922
» INCREMENTAL, CUMULATIVE, COMPLETE EXPORT & IMPORT 조인상 2010.05.12 7144
98 오라클에 접속하는 최대 인스턴스개수(세션개수)를 늘리는 방법 조인상 2010.05.12 7147
97 AIX5.2 + 9.2.0.1.0 install + 9.2.0.5.0 patch 조인상 2010.05.12 7286
96 Linux 32bit ( EntePrise AS 3.0) - 오라클 9.2.0.4 설치 조인상 2010.05.12 7326
서버에 요청 중입니다. 잠시만 기다려 주십시오...