RMAN-06025

今天在恢复一个测试库时遇到一下问题RMAN-06025,现在记录如下:

恢复数据库后报错

SQL> alter database open
  2  /
alter database open
*
ERROR at line 1:
ORA-01113: file 1 needs media recovery
ORA-01110: data file 1:
'/u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_system_dz0r2wwy_.dbf'


SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options


[oracle@momdb123 ~]$ rman target/

Recovery Manager: Release 12.1.0.2.0 - Production on Wed Nov 15 09:37:56 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: MOMDBUAT (DBID=1621115861, not open)
恢复数据库,再跑一次,看看报错



RMAN> recover database;

Starting recover at 15-NOV-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=3 device type=DISK

starting media recovery

archived log for thread 1 with sequence 59 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_59_958385802.dbf
archived log for thread 1 with sequence 60 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_60_958385802.dbf
archived log for thread 1 with sequence 61 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_61_958385802.dbf
archived log for thread 1 with sequence 62 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_62_958385802.dbf
archived log for thread 1 with sequence 63 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_63_958385802.dbf
archived log for thread 1 with sequence 64 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_64_958385802.dbf
archived log for thread 1 with sequence 65 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_65_958385802.dbf
archived log for thread 1 with sequence 66 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_66_958385802.dbf
archived log for thread 1 with sequence 67 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_67_958385802.dbf
archived log for thread 1 with sequence 68 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_68_958385802.dbf
archived log for thread 1 with sequence 69 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_69_958385802.dbf
archived log for thread 1 with sequence 70 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_70_958385802.dbf
archived log for thread 1 with sequence 71 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_71_958385802.dbf
archived log for thread 1 with sequence 72 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_72_958385802.dbf
archived log for thread 1 with sequence 73 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_73_958385802.dbf
archived log for thread 1 with sequence 74 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_74_958385802.dbf
archived log for thread 1 with sequence 75 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_75_958385802.dbf
archived log for thread 1 with sequence 76 is already on disk as file /u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_76_958385802.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 11/15/2017 09:38:02
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of archived log for thread 1 with sequence 58 and starting SCN of 5981333055814 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 57 and starting SCN of 5981327660110 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 56 and starting SCN of 5981322167451 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 55 and starting SCN of 5981319933556 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 54 and starting SCN of 5981314691133 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 53 and starting SCN of 5981309626639 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 52 and starting SCN of 5981275263024 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 51 and starting SCN of 5981259616810 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 50 and starting SCN of 5981183306710 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 49 and starting SCN of 5981182924325 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 48 and starting SCN of 5981182776050 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 47 and starting SCN of 5981177954737 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 46 and starting SCN of 5981096479168 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 45 and starting SCN of 5981094661681 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 44 and starting SCN of 5981094027145 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 43 and starting SCN of 5981094011520 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 42 and starting SCN of 5981093992373 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 41 and starting SCN of 5981093980760 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 40 and starting SCN of 5981093959512 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 39 and starting SCN of 5981093275027 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 38 and starting SCN of 5981088245145 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 37 and starting SCN of 5981006045605 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 36 and starting SCN of 5981001000048 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 35 and starting SCN of 5980938016237 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 34 and starting SCN of 5980932414805 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 33 and starting SCN of 5980866971836 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 32 and starting SCN of 5980861369343 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 31 and starting SCN of 5980855935010 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 30 and starting SCN of 5980787057304 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 29 and starting SCN of 5980781521542 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 28 and starting SCN of 5980749013024 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 27 and starting SCN of 5980712021977 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 26 and starting SCN of 5980706678912 found to restore
RMAN-06025: no backup of archived log for thread 1 with sequence 25 and starting SCN of 5980661990508 found to restore

sequence 24 去重建

RMAN> restore database until sequence 24 thread 1;

Starting restore at 15-NOV-17
using channel ORA_DISK_1

skipping datafile 1; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_system_dz0r2wwy_.dbf
skipping datafile 5; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_undotbs2_dz0r2wwm_.dbf
skipping datafile 19; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_alloc_md_dz0r2x1b_.dbf
skipping datafile 2; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_encrypte_dz0r2wx7_.dbf
skipping datafile 4; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_undotbs1_dz0r2wtt_.dbf
skipping datafile 29; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_alloc3_i_dz0r2wx1_.dbf
skipping datafile 3; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_sysaux_dz0r2wtk_.dbf
skipping datafile 30; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_alloc3_m_dz0r2wvp_.dbf
skipping datafile 33; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_cmx_data_dz0r2x14_.dbf
skipping datafile 6; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_users_dz0r2wvx_.dbf
skipping datafile 28; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_d_dz0r2wxt_.dbf
skipping datafile 44; already restored to file /u01/app/oracle/oradata/ALLOC4_mds.dbf
skipping datafile 7; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_encrypte_dz0r2ww4_.dbf
skipping datafile 11; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_d_dz0r2ww9_.dbf
skipping datafile 20; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_alloc_ia_dz0r2x05_.dbf
skipping datafile 8; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_encrypte_dz0r2wwp_.dbf
skipping datafile 17; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_d_dz0r2wv8_.dbf
skipping datafile 23; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_alloc2_i_dz0r2wvl_.dbf
skipping datafile 9; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_encrypte_dz0r2wyk_.dbf
skipping datafile 18; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_d_dz0r2wvh_.dbf
skipping datafile 43; already restored to file /u01/app/oracle/oradata/ALLOC4_ias_opss.dbf
skipping datafile 10; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_i_dz0r2wz6_.dbf
skipping datafile 16; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_i_dz0r2x02_.dbf
skipping datafile 34; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_d_dz0r2wxg_.dbf
skipping datafile 12; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_lob_data_dz0r2wxl_.dbf
skipping datafile 35; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_d_dz0r2x1x_.dbf
skipping datafile 42; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_sysaux_dz0r2wxs_.dbf
skipping datafile 13; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_i_dz0r2wwm_.dbf
skipping datafile 14; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_i_dz0r2wwr_.dbf
skipping datafile 41; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_sysaux_dz0r2wxj_.dbf
skipping datafile 15; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_i_dz0r2x13_.dbf
skipping datafile 40; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_sysaux_dz0r2ww0_.dbf
skipping datafile 21; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_dev_bipl_dz0r2wvt_.dbf
skipping datafile 22; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_dev_mds_dz0r2wy0_.dbf
skipping datafile 26; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_cmx_data_dz0r2wx6_.dbf
skipping datafile 24; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_alloc2_m_dz0r2wvg_.dbf
skipping datafile 31; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_cmx_data_dz0r2wz2_.dbf
skipping datafile 37; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_sysaux_dz0r2wty_.dbf
skipping datafile 25; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_cmx_inde_dz0r2wvs_.dbf
skipping datafile 32; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_cmx_data_dz0r2x0g_.dbf
skipping datafile 36; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_sysaux_dz0r2wyn_.dbf
skipping datafile 27; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_retail_d_dz0r2wvq_.dbf
skipping datafile 38; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_bip2_mds_dz0r2wwb_.dbf
skipping datafile 39; already restored to file /u01/app/oracle/oradata/MOMDBUAT/datafile/o1_mf_bip2_bip_dz0r2x1y_.dbf
restore not done; all files read only, offline, or already restored
Finished restore at 15-NOV-17

发现已经是already restored了 没有问题

那么让我们去恢复,应用归档日志

RMAN> recover database until sequence 24 thread 1;

Starting recover at 15-NOV-17
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=23
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/mom_arch_MOMDBUAT_20171026_7679_fvsi0d5d_1_1
channel ORA_DISK_1: piece handle=/home/oracle/backup/mom_arch_MOMDBUAT_20171026_7679_fvsi0d5d_1_1 tag=TAG20171026T173229
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
archived log file name=/u01/app/oracle/product/12.0.0/db_home1/dbs/arch1_23_958385802.dbf thread=1 sequence=23
media recovery complete, elapsed time: 00:00:03
Finished recover at 15-NOV-17

此时

SQL> alter database open
  2  /
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open resetlogs
  2  /

Database altered.

SQL> exit

这样测试库就恢复了,因为是测试库,有些操作我们可以忽略一点,比如恢复之前某个节点的数据也可以

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值