본문 바로가기
Oracle/RMAN

[RMAN]백업수행 명령어_독립형,작업형 명령어사용

by 취미툰 2019. 12. 10.
반응형

백업의 명령어의 종류는 크게 독립형과 작업형 명령어 2가지로 나누어지게 됩니다.

독립형은 명령어 한 문장 단위로 작업을 수행하며, 작업형 여러 개의 명령어를 하나의 블록으로 묶어서 한번에 처리하는 방식입니다.

 

1. 독립형 백업 수행

(1) USERS 테이블스페이스 백업

RMAN> backup tablespace users;

 

Starting backup at 19/12/05

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=39 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00007 name=/oradata/ORCL19C/users01.dbf

channel ORA_DISK_1: starting piece 1 at 19/12/05

channel ORA_DISK_1: finished piece 1 at 19/12/05

piece handle=/home/oracle/rman/20191205_0kuilg0p_1_1 tag=TAG20191205T105105 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03

Finished backup at 19/12/05

 

Starting Control File and SPFILE Autobackup at 19/12/05

piece handle=/u01/app/oracle/product/19.5.0/db_1/dbs/c-1490444115-20191205-05 comment=NONE

Finished Control File and SPFILE Autobackup at 19/12/05

 

2. 작업형 백업 수행

2.1 백업파일을 같은 경로에 백업받는 방법

(1) backup file 단위를 100MB로 생성하여 백업 수행

RMAN> run {

allocate channel c1 type disk maxpiecesize 100m;

backup tablespace system

format '/home/oracle/rman/sys_%T_%U';

}

using target database control file instead of recovery catalog

allocated channel: c1

channel c1: SID=39 device type=DISK

 

Starting backup at 19/12/05

channel c1: starting full datafile backup set

channel c1: specifying datafile(s) in backup set

input datafile file number=00001 name=/oradata/ORCL19C/system01.dbf

channel c1: starting piece 1 at 19/12/05

channel c1: finished piece 1 at 19/12/05

piece handle=/home/oracle/rman/sys_20191205_0muilg5u_1_1 tag=TAG20191205T105350 comment=NONE

channel c1: starting piece 2 at 19/12/05

channel c1: finished piece 2 at 19/12/05

piece handle=/home/oracle/rman/sys_20191205_0muilg5u_2_1 tag=TAG20191205T105350 comment=NONE

channel c1: starting piece 3 at 19/12/05

channel c1: finished piece 3 at 19/12/05

piece handle=/home/oracle/rman/sys_20191205_0muilg5u_3_1 tag=TAG20191205T105350 comment=NONE

channel c1: starting piece 4 at 19/12/05

channel c1: finished piece 4 at 19/12/05

piece handle=/home/oracle/rman/sys_20191205_0muilg5u_4_1 tag=TAG20191205T105350 comment=NONE

channel c1: starting piece 5 at 19/12/05

channel c1: finished piece 5 at 19/12/05

piece handle=/home/oracle/rman/sys_20191205_0muilg5u_5_1 tag=TAG20191205T105350 comment=NONE

channel c1: starting piece 6 at 19/12/05

channel c1: finished piece 6 at 19/12/05

piece handle=/home/oracle/rman/sys_20191205_0muilg5u_6_1 tag=TAG20191205T105350 comment=NONE

channel c1: starting piece 7 at 19/12/05

channel c1: finished piece 7 at 19/12/05

piece handle=/home/oracle/rman/sys_20191205_0muilg5u_7_1 tag=TAG20191205T105350 comment=NONE

channel c1: starting piece 8 at 19/12/05

channel c1: finished piece 8 at 19/12/05

piece handle=/home/oracle/rman/sys_20191205_0muilg5u_8_1 tag=TAG20191205T105350 comment=NONE

channel c1: backup set complete, elapsed time: 00:00:18

Finished backup at 19/12/05

 

Starting Control File and SPFILE Autobackup at 19/12/05

piece handle=/u01/app/oracle/product/19.5.0/db_1/dbs/c-1490444115-20191205-06 comment=NONE

Finished Control File and SPFILE Autobackup at 19/12/05

released channel: c1

 

$ls -al

합계 817416

drwxr-xr-x.  2 oracle oinstall      4096 12  5 10:54 .

drwx------. 23 oracle oinstall      4096 12  5 10:45 ..

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:53 sys_20191205_0muilg5u_1_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:53 sys_20191205_0muilg5u_2_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:53 sys_20191205_0muilg5u_3_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:53 sys_20191205_0muilg5u_4_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:54 sys_20191205_0muilg5u_5_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:54 sys_20191205_0muilg5u_6_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:54 sys_20191205_0muilg5u_7_1

-rw-r-----.  1 oracle oinstall 103079936 12  5 10:54 sys_20191205_0muilg5u_8_1

 

 

2.2 업파일을 서로 다른 경로에 백업받는 방법

(1) 서로 다른 경로로 Channel 할당하여 10mb100mb로 백업

 

RMAN> run {

allocate channel c1 type disk maxpiecesize 10m;

allocate channel c2 type disk maxpiecesize 100m;

backup

tablespace users channel c1

format '/home/oracle/rman/users_%T_%U'

tablespace system channel c2

format '/home/oracle/rman2/sys_%T_%U';

}

 

using target database control file instead of recovery catalog

allocated channel: c1

channel c1: SID=268 device type=DISK

 

allocated channel: c2

channel c2: SID=39 device type=DISK

 

Starting backup at 19/12/05

channel c1: starting full datafile backup set

channel c1: specifying datafile(s) in backup set

input datafile file number=00007 name=/oradata/ORCL19C/users01.dbf

channel c1: starting piece 1 at 19/12/05

channel c2: starting full datafile backup set

channel c2: specifying datafile(s) in backup set

input datafile file number=00001 name=/oradata/ORCL19C/system01.dbf

channel c2: starting piece 1 at 19/12/05

channel c1: finished piece 1 at 19/12/05

piece handle=/home/oracle/rman/users_20191205_0ouilgf0_1_1 tag=TAG20191205T105840 comment=NONE

channel c1: starting piece 2 at 19/12/05

channel c1: finished piece 2 at 19/12/05

piece handle=/home/oracle/rman/users_20191205_0ouilgf0_2_1 tag=TAG20191205T105840 comment=NONE

channel c1: starting piece 3 at 19/12/05

channel c2: finished piece 1 at 19/12/05

piece handle=/home/oracle/rman2/sys_20191205_0puilgf0_1_1 tag=TAG20191205T105840 comment=NONE

생략

channel c2: backup set complete, elapsed time: 00:00:41

Finished backup at 19/12/05

 

Starting Control File and SPFILE Autobackup at 19/12/05

piece handle=/u01/app/oracle/product/19.5.0/db_1/dbs/c-1490444115-20191205-07 comment=NONE

Finished Control File and SPFILE Autobackup at 19/12/05

released channel: c1

released channel: c2

 

(2) 서로 다른 경로에 백업 파일 생성 확인

$ls -al|grep users

-rw-r-----.  1 oracle oinstall  10477568 12  5 10:58 users_20191205_0ouilgf0_1_1

-rw-r-----.  1 oracle oinstall  10477568 12  5 10:58 users_20191205_0ouilgf0_2_1

-rw-r-----.  1 oracle oinstall  10477568 12  5 10:58 users_20191205_0ouilgf0_3_1

-rw-r-----.  1 oracle oinstall  10477568 12  5 10:58 users_20191205_0ouilgf0_4_1

-rw-r-----.  1 oracle oinstall  10477568 12  5 10:58 users_20191205_0ouilgf0_5_1

-rw-r-----.  1 oracle oinstall  10477568 12  5 10:58 users_20191205_0ouilgf0_6_1

-rw-r-----.  1 oracle oinstall  10477568 12  5 10:58 users_20191205_0ouilgf0_7_1

-rw-r-----.  1 oracle oinstall   7970816 12  5 10:58 users_20191205_0ouilgf0_8_1

 

$ ls -al

합계 817416

drwxr-xr-x.  2 oracle oinstall      4096 12  5 10:59 .

drwx------. 24 oracle oinstall      4096 12  5 10:57 ..

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:58 sys_20191205_0puilgf0_1_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:58 sys_20191205_0puilgf0_2_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:58 sys_20191205_0puilgf0_3_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:58 sys_20191205_0puilgf0_4_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:58 sys_20191205_0puilgf0_5_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:59 sys_20191205_0puilgf0_6_1

-rw-r-----.  1 oracle oinstall 104849408 12  5 10:59 sys_20191205_0puilgf0_7_1

-rw-r-----.  1 oracle oinstall 103079936 12  5 10:59 sys_20191205_0puilgf0_8_1

반응형

댓글