Oracle/RAW DEVICE

Raw Device 환경에서 RMAN으로 FileSystem으로 데이터파일 백업하기

에몽이ㅋ 2012. 3. 8. 23:01
현재 환경확인
RMAN> report schema;

Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    300      SYSTEM               ***     /dev/raw/raw3
2    200      UNDOTBS1             ***     /dev/raw/raw17
3    120      SYSAUX               ***     /dev/raw/raw4
4    200      UNDOTBS2             ***     /dev/raw/raw18
5    5        USERS                ***     /dev/raw/raw15
6    51       TS_NEW               ***     /dev/raw/raw20

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 600         /dev/raw/raw19


copy datafile x to 'filename'; 으로 백업하면 됩니다. 

run {
copy datafile 1 to '/home/oracle/backup/SYSTEM.dbf';
copy datafile 2 to '/home/oracle/backup/UNDOTBS1.dbf';
copy datafile 3  to '/home/oracle/backup/SYSAUX.dbf';
copy datafile 4 to '/home/oracle/backup/UNDOTBS2.dbf';
copy datafile 5 to '/home/oracle/backup/USERS.dbf';
copy datafile 6 to '/home/oracle/backup/TS_NEW.dbf';
}


RMAN> run {
copy datafile 1 to '/home/oracle/backup/SYSTEM.dbf';
copy datafile 2 to '/home/oracle/backup/UNDOTBS1.dbf';
copy datafile 3  to '/home/oracle/backup/SYSAUX.dbf';
copy datafile 4 to '/home/oracle/backup/UNDOTBS2.dbf';
copy datafile 5 to '/home/oracle/backup/USERS.dbf';
copy datafile 6 to '/home/oracle/backup/TS_NEW.dbf';
}
2> 3> 4> 5> 6> 7> 8>
Starting backup at 08-MAR-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=134 instance=rac1 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00001 name=/dev/raw/raw3

....생략....

Finished backup at 08-MAR-12

Starting backup at 08-MAR-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00005 name=/dev/raw/raw15
output filename=/home/oracle/backup/USERS.dbf tag=TAG20120308T225235 recid=5 stamp=777423156
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 08-MAR-12

Starting backup at 08-MAR-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00006 name=/dev/raw/raw20
output filename=/home/oracle/backup/TS_NEW.dbf tag=TAG20120308T225237 recid=6 stamp=777423158
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 08-MAR-12


파일확인
[oracle@rac1 backup]$ ls -lh
합계 877M
-rw-r-----  1 oracle dba 121M  3월  8 22:52 SYSAUX.dbf
-rw-r-----  1 oracle dba 301M  3월  8 22:52 SYSTEM.dbf
-rw-r-----  1 oracle dba  52M  3월  8 22:52 TS_NEW.dbf
-rw-r-----  1 oracle dba 201M  3월  8 22:52 UNDOTBS1.dbf
-rw-r-----  1 oracle dba 201M  3월  8 22:52 UNDOTBS2.dbf
-rw-r-----  1 oracle dba 5.1M  3월  8 22:52 USERS.dbf
pros : dd명령어와는 다르게 rman으로 copy datafile 시 데이터파일의 크기만큼만 백업합니다.

백업된 파일 복원은
$ dd if=/home/oracle/backup/TS_NEW.dbf of=/dev/raw/raw20 bs=8k
형식으로 하면 됩니다.  


'Oracle > RAW DEVICE' 카테고리의 다른 글

Raw Devices on Linux  (0) 2012.03.08