博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle 11g RMAN 异机恢复报错 RMAN-06172、ORA-07202
阅读量:2497 次
发布时间:2019-05-11

本文共 6531 字,大约阅读时间需要 21 分钟。

Oracle 11g RMAN 异机恢复,恢复参数文件的时候报错。
RMAN> startup nomount
Oracle instance started
Total System Global Area   17103163392 bytes
Fixed Size                     2245480 bytes
Variable Size               2181041304 bytes
Database Buffers           14898167808 bytes
Redo Buffers                  21708800 bytes
RMAN> RUN
{
  ALLOCATE CHANNEL c1 DEVICE TYPE disk;
  SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/bk/rman/%F';
  RESTORE SPFILE 
    TO PFILE '/u01/app/oracle/product/11.2.0/db_1/dbs/initaftdb.ora' 
    FROM AUTOBACKUP;
  SHUTDOWN ABORT;
2> 3> 4> 5> 6> 7> 8> 9> }
allocated channel: c1
channel c1: SID=1072 device type=DISK
executing command: SET CONTROLFILE AUTOBACKUP FORMAT
Starting restore at 24-FEB-16
channel c1: looking for AUTOBACKUP on day: 20160224
channel c1: looking for AUTOBACKUP on day: 20160223
channel c1: looking for AUTOBACKUP on day: 20160222
channel c1: looking for AUTOBACKUP on day: 20160221
channel c1: looking for AUTOBACKUP on day: 20160220
channel c1: looking for AUTOBACKUP on day: 20160219
channel c1: looking for AUTOBACKUP on day: 20160218
channel c1: no AUTOBACKUP in 7 days found
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/24/2016 15:52:07
RMAN-06172: no AUTOBACKUP found or specified handle is not a valid copy or piece
报错原因:
使用 FROM AUTOBACKUP 语句时,默认会搜索7天内的备份数据,如果我们进行恢复的控制文件超过了这个时间范围,就会报错。
解决办法:
可以在语句上面指定 MAXDAYS 参数,将扩大搜寻的时间范围,最大可以指定366天。
RMAN> RUN
{
  ALLOCATE CHANNEL c1 DEVICE TYPE disk;
  SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/bk/rman/%F';
  RESTORE SPFILE 
    TO PFILE '/u01/app/oracle/product/11.2.0/db_1/dbs/initaftdb.ora' 
    FROM AUTOBACKUP  
MAXDAYS 30;
  SHUT2> 3> 4> 5> 6> 7> 8> DOWN ABORT;
}9> 
allocated channel: c1
channel c1: SID=1072 device type=DISK
executing command: SET CONTROLFILE AUTOBACKUP FORMAT
Starting restore at 24-FEB-16
channel c1: looking for AUTOBACKUP on day: 20160224
channel c1: looking for AUTOBACKUP on day: 20160223
channel c1: looking for AUTOBACKUP on day: 20160222
channel c1: looking for AUTOBACKUP on day: 20160221
channel c1: looking for AUTOBACKUP on day: 20160220
channel c1: looking for AUTOBACKUP on day: 20160219
channel c1: looking for AUTOBACKUP on day: 20160218
channel c1: looking for AUTOBACKUP on day: 20160217
channel c1: AUTOBACKUP found: /oradata/bk/rman/c-1864798816-20160217-00
channel c1: restoring spfile from AUTOBACKUP /oradata/bk/rman/c-1864798816-20160217-00
channel c1: SPFILE restore from AUTOBACKUP complete
Finished restore at 24-FEB-16
Oracle instance shut down
--恢复控制文件的时候报错 
ORA-07202
RMAN> RUN 
{
  ALLOCATE CHANNEL c1 DEVICE TYPE disk;
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/bk/rman/%F';
  RESTORE CONTROLFILE FROM AUTOBACKUP MAXDAYS 30;
  ALTER DATABASE MOUNT;
}2> 3> 4> 5> 6> 7> 
allocated channel: c1
channel c1: SID=1174 device type=DISK
executing command: SET CONTROLFILE AUTOBACKUP FORMAT
Starting restore at 24-FEB-16
recovery area destination: /oradata/aftdb
database name (or database unique name) used for search: AFTDB
channel c1: no AUTOBACKUPS found in the recovery area
channel c1: looking for AUTOBACKUP on day: 20160224
channel c1: looking for AUTOBACKUP on day: 20160223
channel c1: looking for AUTOBACKUP on day: 20160222
channel c1: looking for AUTOBACKUP on day: 20160221
channel c1: looking for AUTOBACKUP on day: 20160220
channel c1: looking for AUTOBACKUP on day: 20160219
channel c1: looking for AUTOBACKUP on day: 20160218
channel c1: looking for AUTOBACKUP on day: 20160217
channel c1: AUTOBACKUP found: /oradata/bk/rman/c-1864798816-20160217-00
channel c1: restoring control file from AUTOBACKUP /oradata/bk/rman/c-1864798816-20160217-00
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 02/24/2016 17:28:38
ORA-07202: sltln: invalid parameter to sltln.
仔细查看参数文件,发现 
db_recovery_file_dest 配置成数据文件的上级目录
*.control_files='/oradata/aftdb/controlfile/control01.ctl','/oradata/aftdb/controlfile/control02.ctl'
*.db_create_file_dest='/oradata/aftdb/data'
*.db_create_online_log_dest_1='/oradata/aftdb/log'
*.db_create_online_log_dest_2='/oradata/aftdb/log'
*.db_recovery_file_dest='/oradata/aftdb/
'
*.LOG_ARCHIVE_DEST_1='LOCATION=/oradata/aftdb/arc'
更改如下
*.control_files='/oradata/aftdb/controlfile/control01.ctl','/oradata/aftdb/controlfile/control02.ctl'
*.db_create_file_dest='/oradata/aftdb/data'
*.db_create_online_log_dest_1='/oradata/aftdb/log'
*.db_create_online_log_dest_2='/oradata/aftdb/log'
*.db_recovery_file_dest='/oradata/aftdb/recovery'
*.LOG_ARCHIVE_DEST_1='LOCATION=/oradata/aftdb/arc'
使用新改正后的参数文件重新启动数据库,报错消失,正常恢复控制文件。
RMAN>  RUN 
{
  ALLOCATE CHANNEL c1 DEVICE TYPE disk;
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/oradata/bk/rman/%F';
  RESTORE CONTROLFILE FROM AUTOBACKUP MAXDAYS 30;
  ALTER DATABASE MOUNT;
}2> 3> 4> 5> 6> 7> 
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=1174 device type=DISK
executing command: SET CONTROLFILE AUTOBACKUP FORMAT
Starting restore at 25-FEB-16
recovery area destination: /oradata/aftdb/recovery
database name (or database unique name) used for search: AFTDB
channel c1: no AUTOBACKUPS found in the recovery area
channel c1: looking for AUTOBACKUP on day: 20160225
channel c1: looking for AUTOBACKUP on day: 20160224
channel c1: looking for AUTOBACKUP on day: 20160223
channel c1: looking for AUTOBACKUP on day: 20160222
channel c1: looking for AUTOBACKUP on day: 20160221
channel c1: looking for AUTOBACKUP on day: 20160220
channel c1: looking for AUTOBACKUP on day: 20160219
channel c1: looking for AUTOBACKUP on day: 20160218
channel c1: looking for AUTOBACKUP on day: 20160217
channel c1: AUTOBACKUP found: /oradata/bk/rman/c-1864798816-20160217-00
channel c1: restoring control file from AUTOBACKUP /oradata/bk/rman/c-1864798816-20160217-00
channel c1: control file restore from AUTOBACKUP complete
output file name=/oradata/aftdb/controlfile/control01.ctl
output file name=/oradata/aftdb/controlfile/control02.ctl
Finished restore at 25-FEB-16
database mounted
released channel: c1

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26506993/viewspace-1993939/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26506993/viewspace-1993939/

你可能感兴趣的文章
<h:panelgroup>相当于span元素
查看>>
java中append()的方法
查看>>
必学高级SQL语句
查看>>
经典SQL语句大全
查看>>
log日志记录是什么
查看>>
<rich:modelPanel>标签的使用
查看>>
<h:commandLink>和<h:inputLink>的区别
查看>>
<a4j:keeyAlive>的英文介绍
查看>>
关于list对象的转化问题
查看>>
VOPO对象介绍
查看>>
suse创建的虚拟机,修改ip地址
查看>>
linux的挂载的问题,重启后就挂载就没有了
查看>>
docker原始镜像启动容器并创建Apache服务器实现反向代理
查看>>
docker容器秒死的解决办法
查看>>
管理网&业务网的一些笔记
查看>>
openstack报错解决一
查看>>
openstack报错解决二
查看>>
linux source命令
查看>>
openstack报错解决三
查看>>
乙未年年终总结
查看>>