重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2523|回复: 1
打印 上一主题 下一主题

[备份恢复] rman 备份文件不同路径异机恢复报错

[复制链接]
跳转到指定楼层
楼主
发表于 2017-6-23 09:57:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 jiawang 于 2017-6-23 10:52 编辑

RMAN> run{  
2> set newname for datafile '/u01/app/oracle/oradata/oracle/system01.dbf' to '/u02/backup/system01.dbf';
3> set newname for datafile '/u01/app/oracle/oradata/oracle/sysaux01.dbf' to '/u02/backup/sysaux01.dbf';
4> set newname for datafile '/u01/app/oracle/oradata/oracle/undotbs01.dbf' to '/u02/backup/undotbs01.dbf';
5> set newname for datafile '/u01/app/oracle/oradata/oracle/users01.dbf' to '/u02/backup/users01.dbf';
6> set newname for datafile '/u01/app/oracle/oradata/oracle/example01.dbf' to '/u02/backup/example01.dbf';
7> restore database;
8> switch datafile all;
9> }

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 21-JUN-17
Starting implicit crosscheck backup at 21-JUN-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=10 device type=DISK
Crosschecked 11 objects
Finished implicit crosscheck backup at 21-JUN-17

Starting implicit crosscheck copy at 21-JUN-17
using channel ORA_DISK_1
Finished implicit crosscheck copy at 21-JUN-17

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/app/oracle/fast_recovery_area/ORACLE/autobackup/2017_06_21/o1_mf_s_947205887_dnln7zj8_.bkp
File Name: /u01/app/oracle/fast_recovery_area/ORACLE/autobackup/2017_06_21/o1_mf_s_947203784_dnll6f7t_.bkp

using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/21/2017 04:45:53
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to 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

RMAN>

分析:因为备份位置不一致需要统一路径,运用catalog执行下,再运行run块。
RMAN> catalog start with "/u02/backup";      
searching for all files that match the pattern /u02/backup

List of Files Unknown to the Database
=====================================
File Name: /u02/backup/db_1ns7alvg_1_1.bak
File Name: /u02/backup/o1_mf_s_947214406_dnlwl7d5_.bkp
File Name: /u02/backup/arch_1os7am25_1_1.bak
File Name: /u02/backup/adump/oracle_ora_2576_20170621043926339109143795.aud
File Name: /u02/backup/adump/oracle_ora_2597_20170621044532423158143795.aud
File Name: /u02/backup/adump/oracle_ora_2529_20170621043859694415143795.aud
File Name: /u02/backup/adump/oracle_ora_2568_20170621043859718900143795.aud
File Name: /u02/backup/adump/oracle_ora_2600_20170621044551359424143795.aud
File Name: /u02/backup/adump/oracle_ora_2580_20170621043935788495143795.aud
File Name: /u02/backup/adump/sztech1_ora_2284_20170621042756065330143795.aud
File Name: /u02/backup/adump/oracle_ora_2524_20170621043825204198143795.aud
File Name: /u02/backup/adump/oracle_ora_2596_20170621044532390476143795.aud
File Name: /u02/backup/adump/oracle_ora_2579_20170621043935597095143795.aud
File Name: /u02/backup/adump/sztech1_ora_2323_20170621042756112885143795.aud
File Name: /u02/backup/adump/oracle_ora_2577_20170621043926378574143795.aud
File Name: /u02/backup/adump/oracle_ora_8648_20170621034533026473143795.aud
File Name: /u02/backup/adump/oracle_ora_2484_20170621043825161565143795.aud
File Name: /u02/backup/adump/oracle_ora_2595_20170621044532352386143795.aud
File Name: /u02/backup/adump/oracle_ora_2578_20170621043926419888143795.aud
File Name: /u02/backup/arch_1ms7alv0_1_1.bak

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u02/backup/db_1ns7alvg_1_1.bak
File Name: /u02/backup/o1_mf_s_947214406_dnlwl7d5_.bkp
File Name: /u02/backup/arch_1os7am25_1_1.bak
File Name: /u02/backup/arch_1ms7alv0_1_1.bak

List of Files Which Where Not Cataloged
=======================================
File Name: /u02/backup/adump/oracle_ora_2576_20170621043926339109143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2597_20170621044532423158143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2529_20170621043859694415143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2568_20170621043859718900143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2600_20170621044551359424143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2580_20170621043935788495143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/sztech1_ora_2284_20170621042756065330143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2524_20170621043825204198143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2596_20170621044532390476143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2579_20170621043935597095143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/sztech1_ora_2323_20170621042756112885143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2577_20170621043926378574143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_8648_20170621034533026473143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2484_20170621043825161565143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2595_20170621044532352386143795.aud
  RMAN-07517: Reason: The file header is corrupted
File Name: /u02/backup/adump/oracle_ora_2578_20170621043926419888143795.aud
  RMAN-07517: Reason: The file header is corrupted

RMAN>
再次恢复数据库run块
RMAN> run{  
2> set newname for datafile '/u01/app/oracle/oradata/oracle/system01.dbf' to '/u02/backup/system01.dbf';
3> set newname for datafile '/u01/app/oracle/oradata/oracle/sysaux01.dbf' to '/u02/backup/sysaux01.dbf';
4> set newname for datafile '/u01/app/oracle/oradata/oracle/undotbs01.dbf' to '/u02/backup/undotbs01.dbf';
5> set newname for datafile '/u01/app/oracle/oradata/oracle/users01.dbf' to '/u02/backup/users01.dbf';
6> set newname for datafile '/u01/app/oracle/oradata/oracle/example01.dbf' to '/u02/backup/example01.dbf';
7> restore database;
8> switch datafile all;
9> }

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 21-JUN-17
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u02/backup/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u02/backup/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u02/backup/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u02/backup/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u02/backup/example01.dbf
channel ORA_DISK_1: reading from backup piece /u02/backup/db_1ns7alvg_1_1.bak
channel ORA_DISK_1: piece handle=/u02/backup/db_1ns7alvg_1_1.bak tag=TAG20170621T030520
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 21-JUN-17

datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=947220588 file name=/u02/backup/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=947220588 file name=/u02/backup/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=947220588 file name=/u02/backup/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=947220588 file name=/u02/backup/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=947220588 file name=/u02/backup/example01.dbf



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

沙发
发表于 2017-6-23 10:52:12 | 只看该作者
这个是备份文件在源端和目标端不一致导致的.
使用catalog 让目标端重新注册新的备份文件而已.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-27 19:35 , Processed in 0.089972 second(s), 19 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表