RMAN RESTORE fails with RMAN-06023 or ORA-19505 or RMAN-06100

本文介绍了解决RMAN备份恢复过程中出现的RMAN-06023等错误的方法。通过调整备份通道类型匹配备份方式,成功从磁带备份中恢复数据库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

某个库用nbu做了一个全库备份但不知什么原因,输出日志没了,为了验证备份有效性,使用restore validate database 验证备份有效性。

报错


RMAN> restore validate database;

Starting restore at 07-SEP-2007 20:38:21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=26 devtype=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/07/2017 10:38:22
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no channel*****

查询mos文章发现某文章比较符合

RMAN RESTORE fails with RMAN-06023 or ORA-19505 or RMAN-06100 inspite of proper backups (文档 ID 457769.1)


APPLIES TO:


Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Information in this document applies to any platform.
***Checked for relevance on 20-July-2015***
SYMPTOMS


+ We need to restore database/datafile using the following backup (BackupSet Key# 3):


RMAN> list backup of database;


using target database control file instead of recovery catalog


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
3       Full    347.09M    DISK        00:00:41     07-SEP-2007 19:38:55
        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20070907T193814
        Piece Name: D:\ORACLE\ORADATA\BACKUP\03IRC6P6_1_1
  List of Datafiles in backup set 3
  File LV Type Ckp SCN    Ckp Time             Name
  ---- -- ---- ---------- -------------------- ----
  1       Full 360352     07-SEP-2007 19:38:14 D:\ORACLE\ORADATA\ORA10G\SYSTEM01.DBF
  2       Full 360352     07-SEP-2007 19:38:14 D:\ORACLE\ORADATA\ORA10G\UNDOTBS01.DBF
  3       Full 360352     07-SEP-2007 19:38:14 D:\ORACLE\ORADATA\ORA10G\SYSAUX01.DBF
 
+ However the restore fails with following error:


RMAN> restore datafile 1;


Starting restore at 07-SEP-2007 20:38:21
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=46 devtype=DISK


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/07/2007 20:38:22
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 1 found to restore


OR, with following errors when looking for other backups:
(In case other previous backups exist for this database but we are interested in restoring from the latest backup with BackupSet Key# 3)


ORA-19870: error reading backup piece D:\ORACLE\ORADATA\BACKUP\01IRC6C4_1_1
ORA-19505: failed to identify file "D:\ORACLE\ORADATA\BACKUP\01IRC6C4_1_1"
ORA-27041: unable to open file
OSD-04002: unable to open file
OR
RMAN-06026: some targets not found - aborting restore
RMAN-06100: no channel to restore a backup or copy of datafile 1
 
Or, with below errors after no backup is found and RMAN tries to create the datafile:


creating datafile fno=1 name=+DATA/pzrsa/datafile/system.288.585590761
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/21/2006 21:41:34
ORA-01180: can not create datafile 1
ORA-01110: data file 1: '+DATA/pzrsa/datafile/system.288.585590761'
 
+ We have verified that the backupset 3 is available and accessible:


RMAN> crosscheck backupset 3;


using channel ORA_DISK_1
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=D:\ORACLE\ORADATA\BACKUP\03IRC6P6_1_1 recid=3 stamp=632691494
Crosschecked 1 objects


+ Also the backup exists on DISK and the allocated default channel is of type DISK so there is no mismatch of allocated and required channel type.


+ The checkpoint SCN of datafile 1 in backupset 3 i.e. 360352, seems to belong to the current incarnation (Reset SCN=360002) so there is no mismatch in the incarnation as well:


RMAN> list incarnation of database;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       ORA10G   3944965565       PARENT  289857     19-AUG-2007 22:31:27
2       2       ORA10G   3944965565       CURRENT 360002     07-SEP-2007 19:44:56
CAUSE


Debug the restore session using:


C:\>rman target / log=rmanLog.txt trace=rmanTrace.txt
RMAN> debug on;
RMAN> restore datafile 1;
RMAN> debug off;
RMAN> exit;


rmanLog.txt
===========
RMAN-03090: Starting restore at 07-SEP-2007 21:07:14
RMAN-06009: using target database control file instead of recovery catalog
RMAN-08030: allocated channel: ORA_DISK_1
RMAN-08500: channel ORA_DISK_1: sid=49 devtype=DISK


RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/07/2007 21:08:34
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 1 found to restore


rmanTrace.txt
=============
(Search the debug trace for Checkpoint SCN: "360352" of datafile #1 in backupset #3)
 ...
 DBGRCVMAN:  CheckRecAction called 08/19/07 22:31:27; rlgscn=289857
 DBGRCVMAN: CheckRecAction: inc=1,toscn=360352exceeds 360002
 DBGRCVMAN: CheckRecAction:belongs to orphan branch of this incarnation:
 ...


The debug trace reveals that the backupset 3 belongs to an ORPHAN branch of previous incarnation. Please refer the documentation for more information on Orphan backups and incarnations:


Oracle Database Backup and Recovery Basics 10g Release 2 (10.2)


7.6.2.3 Database Incarnations and Orphaned Backups


This problem usually occurs when restoring on a new instance with FRA configured. When restoring database using a backup controlfile, RMAN automatically catalogs all archives inside the FRA. If there are left over archives, they can add incarnation branches to the restored controlfile causing this issue.


If this is the case, you may consider cleaning up the FRA before starting restore/recover process.


SOLUTION


Restore a control file from the previous incarnation in which the changes represented in the orphan backup has not been abandoned


OR


Reset the database incarnation in current controlfile to the previous one and perform the restore:


RMAN> list incarnation of database;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       ORA10G   3944965565       PARENT  289857     19-AUG-2007 22:31:27
2       2       ORA10G   3944965565       CURRENT 360002     07-SEP-2007 19:44:56


RMAN> reset database to incarnation 1;


database reset to incarnation 1


RMAN> restore datafile 1;


Starting restore at 07-SEP-2007 21:23:55
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=46 devtype=DISK


channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\ORA10G\SYSTEM01.DBF
channel ORA_DISK_1: reading from backup piece D:\ORACLE\ORADATA\BACKUP\03IRC6P6_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\ORACLE\ORADATA\BACKUP\03IRC6P6_1_1 tag=TAG20070907T193814
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 07-SEP-2007 21:24:32



总之文章中所描述的是control文件过旧等问题,但我这里明显不是。

后来仔细想一下,备份是用nbu备份的,通道类型是sbt,而我在执行 restore validate database时是直接敲的命令,那么它使用的通道类型是

disk的。

基于此情况,查看nbu脚本,做出如下修改:

RUN{
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
send channel CHANNEL  ch00 'NB_ORA_POLICY=tmoo_oracle,NB_ORA_CLIENT=tmoo_nbu,NB_ORA_SERV=nbumaster,NB_ORA_SCHED=Default-Application-Backup-tmoo';
ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE';
send channel CHANNEL  ch01 'NB_ORA_POLICY=tmoo_oracle,NB_ORA_CLIENT=tmoo_nbu,NB_ORA_SERV=nbumaster,NB_ORA_SCHED=Default-Application-Backup-tmoo';
backup validate database;
release channel ch00;
release channel ch01;
}
--send channel 中的内容是nbu与数据库的一个接口写法,在备份脚本中找到该配置
<think>好的,我现在需要帮助用户解决在使用RMAN进行活动数据库复制时遇到的RMAN-03009、ORA-17628和ORA-19505错误。首先,我得回忆一下这些错误代码通常代表什么问题。 RMAN-03009通常表示RMAN在执行某个命令时遇到了错误,可能是由于脚本错误或权限问题。ORA-17628涉及到Oracle协议错误,可能和网络或访问权限有关。ORA-19505则通常与文件访问问题相关,比如找不到指定的文件或目录,或者权限不足。 用户提到的是在活动数据库复制(Duplicate Active Database)过程中出现这些错误。根据之前的引用内容,Doc ID 1439632.1和BUG:12609412可能提到了解决方法,比如在磁盘组中创建特定目录,或者检查文件路径是否正确。另外,权限问题也是常见的原因,需要确认辅助实例是否有权限访问相关目录。 接下来,我需要整理解决步骤。首先检查目标目录是否存在,尤其是辅助数据库的磁盘组路径。如果使用ASM,可能需要手动创建目录。然后,确认权限是否正确设置,确保Oracle用户有读写权限。接着,检查初始化参数中的文件路径是否正确,特别是控制文件和日志文件的路径。另外,检查网络连接是否正常,确保主库和辅助库之间的通信没有问题。如果问题依旧,可能需要应用相关的补丁或参考Oracle的文档建议。 最后,生成相关问题的时候,需要考虑用户可能遇到的后续问题,比如如何验证目录权限、如何正确配置初始化文件,或者如何应用Oracle的补丁来解决这类错误。确保用户能够一步步排查问题,并找到解决方案。</think>### RMAN-03009、ORA-17628、ORA-19505 错误解决方案 在使用RMAN执行 **Active Database Duplication** 时,若遇到以下错误组合: - `RMAN-03009`(RMAN命令执行失败) - `ORA-17628`(Oracle协议错误) - `ORA-19505`(文件访问权限或路径问题) 以下是逐步排查和解决方案: --- #### **1. 检查辅助数据库目录权限** - **问题根源**:辅助实例(Auxiliary Instance)无法在目标存储路径(如ASM磁盘组)创建文件[^2]。 - **解决方案**: 1. 登录到辅助数据库服务器,手动创建目标目录: ```sql -- 若使用ASM: ALTER DISKGROUP <磁盘组名称> ADD DIRECTORY '+<磁盘组名称>/<目录路径>'; ``` 2. 确保Oracle用户对目录有读写权限: ```bash chown -R oracle:oinstall /path/to/target chmod -R 775 /path/to/target ``` --- #### **2. 验证文件路径配置** - **问题根源**:`SPFILE` 或 `PFILE` 中配置的文件路径与目标存储不匹配[^1]。 - **解决方案**: 1. 检查辅助实例的初始化参数文件: ```sql -- 确认以下参数指向有效路径: db_file_name_convert = '+DATA/primary_db/datafile', '+DATA/auxiliary_db/datafile' log_file_name_convert = '+REDO/primary_db/onlinelog', '+REDO/auxiliary_db/onlinelog' ``` 2. 若使用ASM,确保路径格式为 `+<磁盘组名称>/<自定义路径>`。 --- #### **3. 修复网络连接问题** - **问题根源**:主库与辅助库之间的TNS通信异常。 - **解决方案**: 1. 使用 `tnsping` 测试连接: ```bash tnsping <辅助库TNS别名> ``` 2. 检查 `tnsnames.ora` 和 `listener.ora` 配置,确保端口和协议一致。 --- #### **4. 应用补丁(若需)** - **问题根源**:已知的Oracle Bug可能导致此问题(如BUG:12609412)[^2]。 - **解决方案**: 1. 查询Oracle支持文档,确认是否需要应用补丁: ```bash opatch apply <补丁号> ``` --- #### **完整示例命令** ```bash # 主库执行RMAN命令: rman TARGET sys@primary DB AUXILIARY sys@auxiliary RUN { ALLOCATE CHANNEL ch1 TYPE DISK; DUPLICATE DATABASE TO auxiliary_db SPFILE SET db_unique_name 'auxiliary_db' NOFILENAMECHECK; } ``` ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值