본문 바로가기
oracle/[Recovery] RMAN & Flashback

[Recovery Manager] RMAN - 백업 (실습)

by #moonyz 2014. 11. 14.

EX1. 전체 데이터베이스 백업하기 (독립형, 작업형 각각 수행)

# 독립형 

RMAN > backup as compressed backupset database format '/data/backup/rman/%U_%T';


# 작업형

RMAN > run{

allocate channel c1 device type disk

backup as compressed backupset database;

format '/data/backup/rman/%U_%T';

}




EX2. channel 3개를 할당해서 example, users, system, control file 백업하기

RMAN > run{

 allocate channel c1 device type disk;

 allocate channel c2 device type disk;

 allocate channel c3 device type disk;

 backup as compressed backupset

 tablespace example, users, system

 include current controlfile;

 }




EX3. 전체 데이터파일의 위치를 확인한 후 파일번호로 백업 수행

RMAN > report schema; --데이터파일 위치확인

RMAN > run{

allocate channel c1 device type disk;

backup as compressed backupset 

datafile 1,2;

}




EX4. 현재사용중인 control file만 백업하기

RMAN > run{

allocate channel c1 device type disk;

backup current controlfile;

}




EX5. 아래의 조건으로 RMAN 백업하기

[조건]

- RMAN을 사용하여 sysaux, example, users 테이블 스페이스를 백업

- 백업경로는 sysaux -> /data/backup/open/

 example -> /data/backup/rman/

 users -> /data/backup/close/

- 독립형 명령어 3번 수행하지 않고 작업형명령어로 한번에 백업

- channel은 3개롤 병렬작업 (채널이름은 아무거나)

- 각 channel은 백업파일하나의 크기가 최대 10M를 넘지않도록 설정


RMAN > run{

allocate channel c1 device type disk maxpiecesize 10M;

allocate channel c2 device type disk maxpiecesize 10M;

allocate channel c3 device type disk maxpiecesize 10M;

backup as compressed backupset

 tablespace sysaux channel c1

  format '/data/backup/open/%U_%T'

 tablespace example channel c2

  format '/data/backup/rman/%U_%T'

 tablespace users channel c3

  format '/data/backup/close/%U_%T'

}




EX6. 차등 증분 백업

RMAN > run{

allocate channel c1 device type disk;

backup as compressed backupset incremental level 0 database

format '/data/backup/rman/%U_%T';

}


RMAN > run{

allocate channel c1 device type disk;

backup as compressed backupset incremental level 3 tablespace users

}




EX7. 누적 증분 백업

RMAN > run{

allocate channel c1 device type disk;

backup as compressed backupset incremental level 3 cumulative

tablespace example;

}




EX8. 전체 데이터파일을 백업하면서 archive log file 함께 백업

RMAN > backup as compressed backupset database plus archivelog

 format '/data/backup/rman/%U_%T';




EX9. archive log file만 백업

RMAN > backup as compressed backupset archivelog all;




댓글