본문 바로가기
🗄️ DB_이야기/# 🛢️ Oracle

[Oracle] RMAN 백업(BACKUPSET)

by gwon_s 2026. 2. 5.

0️⃣ RMAN 백업 정리

RMAN 백업은 크게 3가지가 핵심이

🔹 백업 대상

  • Datafile (SYSTEM, SYSAUX, UNDO, USERS 등)
  • Control File
  • SPFILE
  • Archive Log

 

🔹 Backupset 종류

구분 설명
Full 데이터파일 전체 백업
Incremental Level 0 증분의 기준이 되는 Full
Incremental Level 1 Level 0 이후 변경된 블록만
Archivelog 아카이브 로그 백업

 

🔹RMAN 백업 형식 비교

구분 FULL 백업 Level 0 백업 Level 1 백업 IMAGE COPY
백업 범위 전체 전체 변경 블록만 전체
증분 체계 참여 ⭕ (기준)
기준 백업 필요 ⭕ (Level 0 필요)
백업 형식 BACKUPSET BACKUPSET BACKUPSET IMAGE COPY
데이터 저장 방식 RMAN 포맷 RMAN 포맷 RMAN 포맷 원본 그대로
사용 블록만 백업
압축 가능
증분 가능
복구 속도 보통 보통 느림 빠름
복구 복잡도 낮음 보통 높음 낮음
단독 복구
즉시 전환
실무 사용도 매우 높음 매우 높음 낮음

 

1️⃣ RMAN 접속 (TARGET DB)

🔹OS 인증 접속

rman target /

 

🔹실행 로그를 파일로 저장되는 방식

rman target / log=/backup/rman/rman.log

 

2️⃣ RMAN 설정 확인

SHOW ALL;

확인 포인트

  • RETENTION POLICY
  • PARALLELISM
  • ARCHIVELOG DELETION POLICY

 

3️⃣ Level 0 백업 (전체 기준 백업)

  • Level 0 = 전체 백업
  • 이후 Level 1의 기준점
RUN {
  BACKUP AS COMPRESSED BACKUPSET
    INCREMENTAL LEVEL 0
    DATABASE
    TAG 'LV0_BASE';
}

👉 모든 datafile 백업

👉 backupset 생성

👉 controlfile autobackup 생성

 

4️⃣ 백업 결과 확인

LIST BACKUP SUMMARY;
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
54      B  0  A DISK        26/01/21        1       1       YES        LV0_BASE
55      B  0  A DISK        26/01/21        1       1       YES        LV0_BASE
56      B  0  A DISK        26/01/21        1       1       YES        LV0_BASE

 

 

5️⃣ DB 변경 만들기 (Level 1 테스트용)

create table rman_test (
  id number,
  regdate date
);

insert into rman_test values (1, sysdate);
commit;

 

6️⃣ Level 1 백업 (증분 백업)

  • Level 0 이후 변경된 블록만 백업
RUN {
  BACKUP AS COMPRESSED BACKUPSET
    INCREMENTAL LEVEL 1
    DATABASE
    TAG 'LV1_INC';
}

 

7️⃣ Level 0 / Level 1 결과 확인

LIST BACKUP;
# Level 0 백업 정보
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
68      Incr 0  117.73M    DISK        00:00:25     26/02/05
        BP Key: 68   Status: AVAILABLE  Compressed: YES  Tag: LV0_BASE
        Piece Name: /backup/rman/ORCL_2k4fmbqc_1_1_20260205.bk
  List of Datafiles in backup set 68
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- -------- ----------- ------ ----
  5    0  Incr 2142829    26/01/08              NO    /u01/app/oracle/oradata/orcl/pdbseed/system01.dbf
  6    0  Incr 2142829    26/01/08              NO    /u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf
  8    0  Incr 2142829    26/01/08              NO    /u01/app/oracle/oradata/orcl/pdbseed/undotbs01.dbf
  

# Level 1 백업 정보
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
70      Incr 1  2.23M      DISK        00:00:02     26/02/05
        BP Key: 70   Status: AVAILABLE  Compressed: YES  Tag: LV1_INC
        Piece Name: /backup/rman/ORCL_2m4fme9k_1_1_20260205.bk
  List of Datafiles in backup set 70
  File LV Type Ckp SCN    Ckp Time Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- -------- ----------- ------ ----
  1    1  Incr 3627532    26/02/05              NO    /u01/app/oracle/oradata/orcl/system01.dbf
  3    1  Incr 3627532    26/02/05              NO    /u01/app/oracle/oradata/orcl/sysaux01.dbf
  4    1  Incr 3627532    26/02/05              NO    /u01/app/oracle/oradata/orcl/undotbs01.dbf
  7    1  Incr 3627532    26/02/05              NO    /u01/app/oracle/oradata/orcl/users01.dbf

👉 Level 0의 Size = 117.73M, Level 1의 Size = 2.23M 차이남

 

8️⃣ 아카이브 로그 백업

BACKUP AS COMPRESSED BACKUPSET
  ARCHIVELOG ALL
  DELETE INPUT;

👉 모든 archivelog 백업

👉 백업 완료된 로그 삭제, Data Guard 환경은 환경설정에 따라 standby 적용된 것만 삭제됨

 


👇 Backupset 기반 RMAN 복구 방법은 아래 링크에서 정리했습니다.

 

[Oracle] RMAN 복구(BACKUPSET)

0️⃣ RMAN 복구의 기본 원리 👉 복구는 항상 “백업의 반대 순서”로 진행 Control File→ Datafile (Level 0)→ Datafile (Level 1)→ Archive Log→ OPEN RESETLOGS 1️⃣ 데이터 복구 유형완전 복구불완전 복구2️⃣

gwon-s.tistory.com