RMAN指定备份集恢复(一)

2014-11-24 18:25:31 · 作者: · 浏览: 0

今天在做数据库恢复的时候遇到一个问题,就是有两个目录下面的备份集,想指定备份集来恢复,回来查了下资料,下面做个简单的实验记录:


released channel: ORA_DISK_1
allocated channel: a1
channel a1: sid=144 devtype=DISK


allocated channel: a2
channel a2: sid=148 devtype=DISK


Starting backup at 02-JUL-11
channel a1: starting full datafile backupset
channel a1: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/oracle/app/oracle/oradata/zwh/system01.dbf
input datafile fno=00003 name=/home/oracle/app/oracle/oradata/zwh/sysaux01.dbf
channel a1: starting piece 1 at 02-JUL-11
channel a2: starting full datafile backupset
channel a2: specifying datafile(s) in backupset
input datafile fno=00002 name=/home/oracle/app/oracle/oradata/zwh/undotbs01.dbf
input datafile fno=00004 name=/home/oracle/app/oracle/oradata/zwh/users01.dbf
channel a2: starting piece 1 at 02-JUL-11
channel a2: finished piece 1 at 02-JUL-11
piece handle=/home/oracle/backup/db_arch_6kmgfc5a_1_1 tag=TAG20110702T231137 comment=NONE
channel a2: backup set complete, elapsed time: 00:00:07
channel a2: starting full datafile backupset
channel a2: specifying datafile(s) in backupset
including current control file in backupset
channel a2: starting piece 1 at 02-JUL-11
channel a2: finished piece 1 at 02-JUL-11
piece handle=/home/oracle/backup/db_arch_6lmgfc5i_1_1 tag=TAG20110702T231137 comment=NONE
channel a2: backup set complete, elapsed time: 00:00:07
channel a2: starting full datafile backupset
channel a2: specifying datafile(s) in backupset
including current SPFILE in backupset
channel a2: starting piece 1 at 02-JUL-11
channel a2: finished piece 1 at 02-JUL-11
piece handle=/home/oracle/backup/db_arch_6mmgfc5q_1_1 tag=TAG20110702T231137 comment=NONE
channel a2: backup set complete, elapsed time: 00:00:08
channel a1: finished piece 1 at 02-JUL-11
piece handle=/home/oracle/backup/db_arch_6jmgfc5a_1_1 tag=TAG20110702T231137 comment=NONE
channel a1: backup set complete, elapsed time: 00:00:59
Finished backup at 02-JUL-11


released channel: a1


released channel: a2



在这个时候我在scott用户下删除了2条记录,表空间是users,用于恢复比较用~


RMAN> run{
2> allocate channel a1 type disk;
3> allocate channel a2 type disk;
4> backup database format='/home/oracle/backup2/db2_arch_%U';
5> release channel a1;
6> release channel a2;
7> }


using target database control file instead of recovery catalog
allocated channel: a1
channel a1: sid=141 devtype=DISK


allocated channel: a2
channel a2: sid=143 devtype=DISK


Starting backup at 02-JUL-11
channel a1: starting full datafile backupset
channel a1: specifying datafile(s) in backupset
input datafile fno=00001 name=/home/oracle/app/oracle/oradata/zwh/system01.dbf
input datafile fno=00003 name=/home/oracle/app/oracle/oradata/zwh/sysaux01.dbf
channel a1: starting piece 1 at 02-JUL-11
channel a2: starting full datafile backupset
channel a2: specifying datafile(s) in backupset
input datafile fno=00002 name=/home/oracle/app/oracle/oradata/zwh/undotbs01.dbf
input datafile fno=00004 name=/home/oracle/app/oracle/oradata/zwh/users01.dbf
channel a2: starting piece 1 at 02-JUL-11
channel a2: finished piece 1 at 02-JUL-11
piece handle=/home/oracle/backup2/db2_arch_6omgfciq_1_1 tag=TAG20110702T231850 comment=NONE
channel a2: backup set complete, elapsed time: 00:00:07
channel a2: starting full datafile backupset
channel a2: specifying datafile(s) in backupset
including current control file in backupset
cha