Oracle RMAN-06023 和ORA-19693错误(一)

2015-07-16 12:08:27 · 作者: · 浏览: 4

在将一个0级备份的数据库还原到其它机器上时,首先遇到了RMAN-06023然后遇到ORA-19693错误,错误发生的环境和内容大致如下:
数据库版本:


开始还原数据库:


startup nomount;
RMAN> restore controlfile from 'I:\backup\C-2711934557-20150401-02_NSOA_CONTROLFILE_20150401';
启动 restore 于 2015-04-10 15:09:01
使用目标数据库控制文件替代恢复目录
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=129 设备类型=DISK


通道 ORA_DISK_1: 正在还原控制文件
通道 ORA_DISK_1: 还原完成, 用时: 00:00:08
输出文件名=I:\NSOADP\CONTROL01.CTL
完成 restore 于 2015-04-10 15:09:10


RMAN> alter database mount;
RMAN>run
{
allocate channel dev type disk;
allocate channel dev1 type disk;
set newname for datafile 1 to 'd:\nsoadp\SYSTEM01.DBF';
set newname for datafile 2 to 'd:\nsoadp\SYSAUX01.DBF';
set newname for datafile 4 to 'd:\nsoadp\USERS01.DBF';
……………
restore database;
switch datafile all;
recover database;
release channel dev;
release channel dev1;
}
正在执行命令: SET NEWNAME


正在执行命令: SET NEWNAME
………
启动 restore 于 2015-04-10 15:30:19
通道 dev: 正在开始还原数据文件备份集
通道 dev: 正在指定从备份集还原的数据文件
RMAN-06026: 有些目标没有找到 - 终止还原
RMAN-06023: 没有找到数据文件4的副本来还原
RMAN-06023: 没有找到数据文件2的副本来还原
RMAN-06023: 没有找到数据文件1的副本来还原


?


?但实际在0级备份中是包含这些数据文件的:


?


RMAN> list backup of datafile 4,2,1;
备份集列表
===================
BS 关键字? 类型 LV 大小? ? ? 设备类型 经过时间 完成时间
------- ---- -- ---------- ----------- ------------ -------------------
10071? Incr 0? 30.29G? ? DISK? ? ? ? 02:46:53? ? 2015-04-01 13:29:12
? ? ? ? BP 关键字: 10071? 状态: AVAILABLE? 已压缩: YES? 标记: NSOA_BACKUP_INCR0
段名:I:\BACKUP\B_NSOA_10193_UHQ39J0B_20150401
? 备份集 10071 中的数据文件列表
? 文件 LV 类型 Ckp SCN? ? Ckp 时间? ? ? ? ? ? 名称
? ---- -- ---- ---------- ------------------- ----
? 4? ? 0? Incr 13625590769939 2015-04-01 10:42:20 G:\U09\ORADATA\NSOA\USERS01.DBF


BS 关键字? 类型 LV 大小? ? ? 设备类型 经过时间 完成时间
------- ---- -- ---------- ----------- ------------ -------------------
10072? Incr 0? 29.04G? ? DISK? ? ? ? 02:47:11? ? 2015-04-01 13:29:30
? ? ? ? BP 关键字: 10072? 状态: AVAILABLE? 已压缩: YES? 标记: NSOA_BACKUP_INCR0
段名:I:\BACKUP\B_NSOA_10192_UGQ39J0B_20150401
? 备份集 10072 中的数据文件列表
? 文件 LV 类型 Ckp SCN? ? Ckp 时间? ? ? ? ? ? 名称
? ---- -- ---- ---------- ------------------- ----
? 1? ? 0? Incr 13625590769907 2015-04-01 10:42:19 G:\U07\ORADATA\NSOA\SYSTEM01.DBF
? 2? ? 0? Incr 13625590769907 2015-04-01 10:42:19 G:\U08\ORADATA\NSOA\SYSAUX01.DBF


?


?因此可以确定,备份文件本身是没有问题的,问题出在


If we start a RESTORE database with a BACKUP controlfile and Flash Recovery Area is defined, RMAN execute and implicit crosscheck and catalog of all the objects in the Flash Recovery Area.
RMAN will catalog any objects in the Flash Recovery Area that will not be registered in the controlfile and if any of this files belongs to an incarnation different from CURRENT incarnation in the controlfile then changes controlfile CURRENT incarnation to the one found in the file that is being cataloged.
This prevents database from restoring backups that belong to old CURRENT incarnation.
RMAN considers backup availble for being restored if the backup incarnation and CURRENT incarnation in controlfile are the same.?


根据文档说明,我设置了db_recovery_file_dest和 db_recovery_file_dest_size参数并重新还原了控制文件,然后在还原时将catalog 指向我的备份文件所在目录:


?


RMAN> restore controlfile from 'I:\backup\C-2711934557-20150401-02_NSOA_CONTROLFILE_20150401';
RMAN> alter database mount;
RMAN> catalog start with 'I:\backup';


启动 implicit crosscheck backup 于 2015-04-10 15:09:40
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=129 设备类型=DISK
已交叉检验的 29 对象
完成 implicit crosscheck backup 于 2015-04-10 15:10:37


启动 implicit crosscheck copy 于 2015-04-10 15:10:37
使用通道 ORA_DISK_1
完成 implicit crosscheck copy 于 2015-04-10