首页  >  文章  >  数据库  >  Oracle RMAN-06023 和ORA-19693错误

Oracle RMAN-06023 和ORA-19693错误

WBOY
WBOY原创
2016-06-07 16:00:431518浏览

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

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

开始还原数据库:

SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production

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 15:10:37

搜索恢复区中的所有文件
正在编制文件目录...
没有为文件编制目录

搜索与样式 I:\backup 匹配的所有文件

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn