`
helloyesyes
  • 浏览: 1306578 次
  • 性别: Icon_minigender_2
  • 来自: 武汉
文章分类
社区版块
存档分类
最新评论

RMAN-06023 : no backup or copy of datafile found to restore 说明

阅读更多

RMAN 的备份信息如下:

RMAN> list backupset summary;

List of Backups

===============

Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag

------- -- -- - ----------- --------------- ------- ------- ---------- ---

9 b 1 a disk 01-jun-11 1 1 no dave_lev1

10 b 1 a disk 01-jun-11 1 1 no dave_lev1

13 b a a disk 01-jun-11 1 1 no arc_bak

14 b a a disk 01-jun-11 1 1 no arc_bak

15 b a a disk 01-jun-11 1 1 no arc_bak

16 b a a disk 01-jun-11 1 1 no arc_bak

17 b a a disk 01-jun-11 1 1 no arc_bak

18 b a a disk 01-jun-11 1 1 no arc_bak

19 b a a disk 01-jun-11 1 1 no arc_bak

20 b a a disk 01-jun-11 1 1 no arc_bak

21 b a a disk 01-jun-11 1 1 no arc_bak

22 b f a disk 01-jun-11 1 1 no bak_ctlfile

23 b f a disk 01-jun-11 1 1 no spfile

RMAN> crosscheck backup;

using channel ORA_DISK_1

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/dave_lev1_0cmdpuof_1_1_20110601 recid=9 stamp=752679695

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/dave_lev1_0bmdpuoe_1_1_20110601 recid=10 stamp=752679695

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0fmdpven_1_1_20110601 recid=13 stamp=752680408

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0gmdpven_1_1_20110601 recid=14 stamp=752680422

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0hmdpvj4_1_1_20110601 recid=15 stamp=752680549

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0imdpvj5_1_1_20110601 recid=16 stamp=752680582

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0jmdpvo4_1_1_20110601 recid=17 stamp=752680709

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0kmdpvo5_1_1_20110601 recid=18 stamp=752680721

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0mmdpvss_1_1_20110601 recid=19 stamp=752680863

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0lmdpvsr_1_1_20110601 recid=20 stamp=752680860

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/arch_0nmdpvv0_1_1_20110601 recid=21 stamp=752680929

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/ctl_file_0omdpvv7_1_1_20110601 recid=22 stamp=752680937

crosschecked backup piece: found to be 'AVAILABLE'

backup piece handle=/u01/backup/dave_spfile_0pmdpvva_1_1_20110601 recid=23 stamp=752680939

Crosschecked 13 objects

但是restore validate的时候, 报错:

RMAN> restore database validate;

Starting restore at 01-JUN-11

using channel ORA_DISK_1

RMAN-00571: =================================================

RMAN-00569: ===== ERROR MESSAGE STACK FOLLOWS ====

RMAN-00571: ==========================================

RMAN-03002: failure of restore command at 06/01/2011 21:21:28

RMAN-06026: some targets not found - aborting restore

RMAN-06023: no backup or copy of datafile 3 found to restore

RMAN-06023: no backup or copy of datafile 2 found to restore

RMAN-06023: no backup or copy of datafile 1 found to restore

一般来说,遇到这种问题是因为控制过旧,即控制文件中没有备份的信息。

比如在nocatalog模式下,备份数据文件之前,先备份控制文件,然后在备份数据库。 在还原的时候,先还原还原控制文件,此时的控制文件中并没有包含RMAN 备份的信息,这时进行恢复就会遇到RMAN-06023 的错误。 但我这里控制文件没有修改。 所以不是这个原因造成。

google 一下。 有网友通过以下几种方法解决了这个问题:

1. shutdown abort

2. crosscheck backup

3 设置 DBID

4. 重建UNDO Tablespace

这几种方法是问题的一方面,不过我遇到的情况还有一个特殊性。 就是我的RMAN 采用了增量备份,但是我没有做0级备份,而是直接用1级备份。 这种情况下,RMAN 发现没有0级备份,所以此时的1级备份也相当于0级备份。

尝试重新做了一次0级备份,在次validate,居然ok了。

RMAN> RESTORE DATABASE VALIDATE;

Starting restore at 01-JUN-11

using channel ORA_DISK_1

channel ORA_DISK_1: starting validation of datafile backupset

channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev0_10mdqqtd_1_1_20110601

channel ORA_DISK_1: restored backup piece 1

piece handle=/u01/backup/dave_lev0_10mdqqtd_1_1_20110601 tag=DAVE_LEV0

channel ORA_DISK_1: validation complete, elapsed time: 00:00:07

channel ORA_DISK_1: starting validation of datafile backupset

channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev0_0vmdqqtd_1_1_20110601

channel ORA_DISK_1: restored backup piece 1

piece handle=/u01/backup/dave_lev0_0vmdqqtd_1_1_20110601 tag=DAVE_LEV0

channel ORA_DISK_1: validation complete, elapsed time: 00:00:15

Finished restore at 01-JUN-11

正常情况下直接进行1级备份也是可以进行恢复的。 所以不应该出现这种问题。 所以在进行一次测试,就是使用1级备份进行恢复,看这种备份能否正常用于恢复。

到另一台单实例测试库上进行一下测试。 上面这台是我的RAC 测试库,折腾坏了,一时也没空去捣鼓。

备份脚本参考:

Nocatalog 下的RMAN 增量备份 shell脚本

http://blog.csdn.net/tianlesoftware/archive/2011/01/26/6164931.aspx

先做一个1级备份:

RMAN> list backup summary;

using target database control file instead of recovery catalog

List of Backups

===============

key ty lv s device type completion time #pieces #copies compressed tag

------- -- -- - ----------- --------------- ------- ------- ---------- ---

5 b 1 a disk 02-jun-11 1 1 no dave_lev1

6 b 1 a disk 02-jun-11 1 1 no dave_lev1

9 b a a disk 02-jun-11 1 1 no arc_bak

10 b a a disk 02-jun-11 1 1 no arc_bak

11 b f a disk 02-jun-11 1 1 no bak_ctlfile

12 b f a disk 02-jun-11 1 1 no spfile

restore 进行一次验证:

RMAN> restore database validate;

Starting restore at 02-JUN-11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=148 devtype=DISK

channel ORA_DISK_1: starting validation of datafile backupset

channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev1_0amdrva4_1_1_20110602

channel ORA_DISK_1: restored backup piece 1

piece handle=/u01/backup/dave_lev1_0amdrva4_1_1_20110602 tag=DAVE_LEV1

channel ORA_DISK_1: validation complete, elapsed time: 00:00:08

channel ORA_DISK_1: starting validation of datafile backupset

channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev1_09mdrva3_1_1_20110602

channel ORA_DISK_1: restored backup piece 1

piece handle=/u01/backup/dave_lev1_09mdrva3_1_1_20110602 tag=DAVE_LEV1

channel ORA_DISK_1: validation complete, elapsed time: 00:00:16

Finished restore at 02-JUN-11

居然没有报错,灵异事件啊。

灵异就灵异吧,继续验证下这个1级备份的恢复问题。

RMAN> shutdown immediate

database closed

database dismounted

Oracle instance shut down

RMAN> startup mount;

connected to target database (not started)

Oracle instance started

database mounted

Total System Global Area 239075328 bytes

Fixed Size 1218700 bytes

Variable Size 83887988 bytes

Database Buffers 146800640 bytes

Redo Buffers 7168000 bytes

RMAN> restore database;

Starting restore at 02-JUN-11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=157 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00002 to /u01/app/oracle/oradata/dave1/undotbs01.dbf

restoring datafile 00003 to /u01/app/oracle/oradata/dave1/sysaux01.dbf

restoring datafile 00005 to /u01/app/oracle/oradata/dave1/example01.dbf

channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev1_0amdrva4_1_1_20110602

channel ORA_DISK_1: restored backup piece 1

piece handle=/u01/backup/dave_lev1_0amdrva4_1_1_20110602 tag=DAVE_LEV1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:25

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

restoring datafile 00001 to /u01/app/oracle/oradata/dave1/system01.dbf

restoring datafile 00004 to /u01/app/oracle/oradata/dave1/users01.dbf

channel ORA_DISK_1: reading from backup piece /u01/backup/dave_lev1_09mdrva3_1_1_20110602

channel ORA_DISK_1: restored backup piece 1

piece handle=/u01/backup/dave_lev1_09mdrva3_1_1_20110602 tag=DAVE_LEV1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:35

Finished restore at 02-JUN-11

RMAN> recover database;

Starting recover at 02-JUN-11

using channel ORA_DISK_1

starting media recovery

media recovery complete, elapsed time: 00:00:06

Finished recover at 02-JUN-11

RMAN> alter database open;

database opened

这种1级备份可以用来恢复。之前还遇到过一次rman 过期备份集在自动备份脚本里用: delete noprompt expired backup; 不能删除的问题。

有遇到这种情况的同学也可以说说。

-------------------------------------------------------------------------------------------------------

Blog http://blog.csdn.net/tianlesoftware

Email: dvd.dba@gmail.com

DBA1 群:62697716(); DBA2 群:62697977() DBA3 群:62697850()

DBA 超级群:63306533(); DBA4 群: 83829929 DBA5群: 142216823

DBA6 群:158654907 聊天 群:40132017 聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

分享到:
评论

相关推荐

    RMAN - Getting Started

    restore datafile '/path/to/lost/file'; recover datafile '/path/to/lost/file'; ``` ### 实战演练 通过阅读`RMAN 8.0 to 8i - Getting Started.html`这份文档,你可以详细了解从Oracle 8.0到8i版本的RMAN...

    oracle恢复工具-FY_Recover_Data

    15:33:05: Copy file of Recover Tablespace: FY_REC_DATA_COPY.DAT 15:33:05: begin to recover table SYS.TRUNTAB1 15:33:19: [restore_table] Trying to restore data to SYS.TRUNTAB1$$2 15:33:20: [restore_...

    三思笔记Rman

    三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思...

    oracle11g 内部参数出错问题

    这可能涉及到使用`ALTER DATABASE DATAFILE ... OFFLINE`将文件脱机,然后使用`RESTORE`和`RECOVER`命令尝试恢复。 5. **检查硬件和操作系统**:错误也可能源于硬件故障或操作系统层面的问题,所以检查存储设备、...

    rman-xttconvert_2.0.zip

    【标题】"rman-xttconvert_2.0.zip" 涉及的主要知识点是Oracle数据库的RMAN(恢复管理器)与XTT(XML Transfer Tool)工具的结合使用,用于数据转换和备份恢复。 在Oracle数据库管理中,RMAN(Recovery Manager)是...

    MetaLink-RMAN RAC Backup and Recovery using RMAN

    MetaLink-RMAN RAC Backup and Recovery using RMAN 希望对ORACLE使用者有点作用

    rman backup

    - `backup as copy <file_spec>`:创建数据文件的副本,而不是备份。 4. RMAN通道: - 通道是RMAN用于执行备份和恢复任务的并行进程。可以配置多个通道以提高备份速度。 - 默认通道通常是磁盘通道,但也可以配置...

    Oracle数据备份&恢复

    使用RMAN的`backup full database`命令可以备份整个数据库,而`restore`命令用于恢复。RMAN提供了更高级的功能,如增量备份、压缩备份和自动备份策略。 Exp/Imp工具是Oracle早期的备份和迁移工具,虽然现在已经被...

    rman.zip_oracle_rman

    Oracle RMAN(Recovery Manager)是Oracle数据库管理系统中一个强大的备份和恢复工具,它提供了全面的数据保护方案。在Oracle环境中,RMAN能够执行各种备份操作,包括冷备份和热备份,以确保数据的安全性和可恢复性...

    Oracle实用RMAN命令

    - **命令**:`COPY DATAFILE 1 TO '/oracle/dbs/system.copy';` - **解释**:复制编号为1的数据文件到指定的位置。 ##### 10. 列出备份和文件副本 - **命令**:`LIST BACKUP;` - **解释**:列出所有已备份的数据和...

    Oracle_RMAN快速入门.pdf

    - **示例**: 当遇到物理损坏的数据库文件时,可以使用 RMAN 的 `restore and recover datafile` 命令来修复数据文件。 ```sql RMAN> restore datafile 3; RMAN> recover datafile 3; ``` #### 结论 RMAN 是 ...

    oracle rman 备份基础

    RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog ``` **解决方法**: - 使用 `register database` 命令完成注册。 **RMAN命令**: ```...

    oracle_rman增量备份脚本

    create tablespace rman_tbs datafile '/oradata/luke/rman_tbs01.dbf' size 1024M; ``` - 创建名为`rman_dlp`的用户,并指定默认表空间为`rman_tbs`。 ```sql create user rman_dlp identified by dlp default...

    Oracle 12c Rman Backup and Recovery

    9. **恢复数据文件**:通过`RESTORE DATAFILE`命令恢复单个数据文件。 10. **恢复数据库**:使用`RESTORE DATABASE`命令恢复整个数据库。 #### 五、RMAN高级特性 - **加密**:RMAN支持对备份数据进行加密,增强...

    rman-xttconvert_2.0.rar

    在"rman-xttconvert_2.0.rar"这个压缩包中,包含了XTTConvert工具的最新版本2.0。这个版本可能引入了更多的性能优化和新特性,例如更快的转换速度、更好的错误处理机制、支持更大规模的XML数据处理等。对于那些拥有...

    rman备份恢复实例

    - 复制数据文件:`copy datafile 1 to '/home/oracle/backup/system.copy';` ### 九、查看备份列表 - 列出所有备份:`list backup;` ### 十、验证备份 - 验证备份集:`validate backupset 3;` ### 十一、恢复操作...

    使用rman恢复数据库,备份与恢复

    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/backup/practice/AUTO_C_SP_%F.rbf'; ``` - **2.2 创建0级备份**: - 分配通道:`ALLOCATE CHANNEL c1 DEVICE TYPE DISK FORMAT '/backup/...

    oracle11g_rman备份还原初步方案(20190524).docx

    - `configure retention policy to recovery window of 7 days;` - 保留足够多的备份,以便可以将数据库恢复到最近七天内的任意时刻。超过最近七天的数据库备份将被标记为obsolete。 - `configure retention ...

Global site tag (gtag.js) - Google Analytics