rman恢复报错ORA-01110: data file 1

在进行一次从RMAN全备份文件中(有全备文件集,归档备份,控制文件及spfile)在异地恢复时遇到报错,恢复不成功,开始怀疑是数据库修改过归档目录引起归档日志备份不成功。但当把最近的归档日志恢复出来后,仍然报同样的错误。接着发现一个datafile的状态为offline,进而看到其checkpiont是很早以前的。问题就出在这里。以下是整个恢复过程:
一、恢复pfile
RMAN> restore spfile to '/opt/oracle/backup/spfile.ora' from '/opt/oracle/backup/itown01_20120723_9910_1.spf';
Starting restore at 27-JUL-12
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=12 devtype=DISK
channel ORA_DISK_1: autobackup found: /opt/oracle/backup/itown01_20120723_9910_1.spf
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 27-JUL-12
RMAN> exit  
SQL> create pfile='/opt/oracle/backup/pfile.ora' from spfile='/opt/oracle/backup/spfile.ora'
  2  ;
File created.
SQL>
二、启动到nomount
SQL> connect / as sysdba
Connected to an idle instance.
SQL> startup nomount pfile='/opt/oracle/backup/pfile.ora';
ORACLE instance started.
Total System Global Area 1678842656
bytes
Fixed Size                   453408
bytes
Variable Size             838860800
bytes
Database Buffers          838860800
bytes
Redo Buffers                 667648
bytes
SQL> create spfile from pfile='/opt/oracle/backup/pfile.ora';
File created.
SQL> exit
三、recover
RMAN> connect target /  
connected to target database: itown01m (not mounted)
RMAN> set dbid=2826132969
executing command: SET DBID
RMAN> restore controlfile from '/opt/oracle/backup/itown01_20120723_9911_1.ctl_1.ctl';
Starting restore at 27-JUL-12
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=12 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=/u01/product/oradata/itown01m/control01.ctl
output filename=/u01/product/oradata/itown01m/control02.ctl
output filename=/u01/product/oradata/itown01m/control03.ctl
Finished restore at 27-JUL-12
RMAN> alter database mount;
RMAN> run{
set until sequence 195375 thread 1;
2> 3> restore database;
4> recover database;
5> }
executing command: SET until clause
Starting restore at 31-JUL-12
using channel ORA_DISK_1
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/product/oradata/itown01m/system01.dbf
restoring datafile 00017 to /u01/product/oradata/itown01m/et_tab_s_01.dbf
restoring datafile 00022 to /u01/product/oradata/itown01m/et_tab_l_03.dbf
restoring datafile 00030 to /u01/product/oradata/itown01m/ss01.dbf
restoring datafile 00031 to /u01/product/oradata/itown01m/ss_h1n101.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/backup/itown01_20120723_9904_1.dbf tag=TAG20120723T040049 params=NULL
channel ORA_DISK_1: restore complete
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /u01/product/oradata/itown01m/drsys01.dbf
restoring datafile 00005 to /u01/product/oradata/itown01m/example01.dbf
restoring datafile 00013 to /u01/product/oradata/itown01m/et_tab_l_01.dbf
restoring datafile 00014 to /u01/product/oradata/itown01m/system02.dbf
restoring datafile 00023 to /u01/product/oradata/itown01m/et_tab_l_04.dbf
restoring datafile 00036 to /u01/product/oradata/itown01m/ss02.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/backup/itown01_20120723_9905_1.dbf tag=TAG20120723T040049 params=NULL
channel ORA_DISK_1: restore complete
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/product/oradata/itown01m/undotbs01.dbf
restoring datafile 00012 to /u01/product/oradata/itown01m/et_idx_l_01.dbf
restoring datafile 00016 to /u01/product/oradata/itown01m/et_idx_s_01.dbf
restoring datafile 00021 to /u01/product/oradata/itown01m/et_tab_xl_02.dbf
restoring datafile 00027 to /u01/product/oradata/itown01m/jablog02.dbf
restoring datafile 00035 to /u01/product/oradata/itown01m/bas01.dbf
restoring datafile 00037 to /u01/product/oradata/itown01m/cm02.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/backup/itown01_20120723_9906_1.dbf tag=TAG20120723T040049 params=NULL
channel ORA_DISK_1: restore complete
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /u01/product/oradata/itown01m/cwmlite01.dbf
restoring datafile 00007 to /u01/product/oradata/itown01m/odm01.dbf
restoring datafile 00008 to /u01/product/oradata/itown01m/tools01.dbf
restoring datafile 00010 to /u01/product/oradata/itown01m/xdb01.dbf
restoring datafile 00015 to /u01/product/oradata/itown01m/undotbs02.dbf
restoring datafile 00020 to /u01/product/oradata/itown01m/et_tab_l_02.dbf
restoring datafile 00026 to /u01/product/oradata/itown01m/jablog01.dbf
restoring datafile 00028 to /u01/product/oradata/itown01m/users03.dbf
restoring datafile 00032 to /u01/product/oradata/itown01m/isys01.dbf
restoring datafile 00033 to /u01/product/oradata/itown01m/cm01.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/backup/itown01_20120723_9907_1.dbf tag=TAG20120723T040049 params=NULL
channel ORA_DISK_1: restore complete
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to /u01/product/oradata/itown01m/indx01.dbf
restoring datafile 00009 to /u01/product/oradata/itown01m/users01.dbf
restoring datafile 00011 to /u01/product/oradata/itown01m/et_tab_xl_01.dbf
restoring datafile 00018 to /u01/product/oradata/itown01m/et_fee_tab_01.dbf
restoring datafile 00019 to /u01/product/oradata/itown01m/et_fee_idx_01.dbf
restoring datafile 00024 to /u01/product/oradata/itown01m/et_tab_xl_03.dbf
restoring datafile 00025 to /u01/product/oradata/itown01m/users02.dbf
restoring datafile 00029 to /u01/product/oradata/itown01m/users04.dbf
restoring datafile 00034 to /u01/product/oradata/itown01m/it_fee01.dbf
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/backup/itown01_20120723_9908_1.dbf tag=TAG20120723T040049 params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 31-JUL-12
Starting recover at 31-JUL-12
using channel ORA_DISK_1
starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/product/oradata/itown01m/system01.dbf'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/31/2012 11:02:54
RMAN-06053: unable to perform. media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 195352 scn 9513178976437 found to restore
RMAN-06025: no backup of log thread 1 seq 195351 scn 9513178974630 found to restore
RMAN-06025: no backup of log thread 1 seq 195350 scn 9513178971090 found to restore
RMAN-06025: no backup of log thread 1 seq 195349 scn 9513178926221 found to restore
RMAN-06025: no backup of log thread 1 seq 195348 scn 9513178923827 found to restore
RMAN-06025: no backup of log thread 1 seq 195347 scn 9513178921875 found to restore
RMAN-06025: no backup of log thread 1 seq 195346 scn 9513178920145 found to restore
RMAN-06025: no backup of log thread 1 seq 195345 scn 9513178841667 found to restore
RMAN-06025: no backup of log thread 1 seq 195344 scn 9513178838073 found to restore
RMAN-06025: no backup of log thread 1 seq 195343 scn 9513178835907 found to restore
RMAN-06025: no backup of log thread 1 seq 195342 scn 9513178834071 found to restore
RMAN-06025: no backup of log thread 1 seq 195341 scn 9513178832365 found to restore
RMAN-06025: no backup of log thread 1 seq 195340 scn 9513178793681 found to restore
RMAN-06025: no backup of log thread 1 seq 195339 scn 9513178790355 found to restore
RMAN-06025: no backup of log thread 1 seq 195338 scn 9513178788305 found to restore
RMAN-06025: no backup of log thread 1 seq 195337 scn 9513178786372 found to restore
RMAN-06025: no backup of log thread 1 seq 195336 scn 9513178780586 found to restore
RMAN-06025: no backup of log thread 1 seq 195335 scn 9513178740495 found to restore
RMAN-06025: no backup of log thread 1 seq 195334 scn 9513178737628 found to restore
RMAN-06025: no backup of log thread 1 seq 195333 scn 9513178735681 found to restore
RMAN-06025: no backup of log thread 1 seq 195332 scn 9513178733922 found to restore
RMAN-06025: no backup of log thread 1 seq 195331 scn 9513178730090 found to restore
RMAN-06025: no backup of log thread 1 seq 195330 scn 9513178670788 found to restore
RMAN-06025: no backup of log thread 1 seq 195329 scn 9513178668403 found to restore
RMAN-06025: no backup of log thread 1 seq 195328 scn 9513178666438 found to restore
RMAN-06025: no backup of log thread 1 seq 195327 scn 9513178664711 found to restore
RMAN-06025: no backup of log thread 1 seq 195326 scn 9513178627155 found to restore
RMAN-06025: no backup of log thread 1 seq 195325 scn 9513178623613 found to restore
RMAN-06025: no backup of log thread 1 seq 195324 scn 9513178621484 found to restore
RMAN-06025: no backup of log thread 1 seq 195323 scn 9513178619620 found to restore
RMAN-06025: no backup of log thread 1 seq 195322 scn 9513178617849 found to restore
RMAN-06025: no backup of log thread 1 seq 195321 scn 9513178572577 found to restore
RMAN-06025: no backup of log thread 1 seq 195320 scn 9513178569205 found to restore
RMAN-06025: no backup of log thread 1 seq 195319 scn 9513178567200 found to restore
RMAN-06025: no backup of log thread 1 seq 195318 scn 9513178565271 found to restore
RMAN-06025: no backup of log thread 1 seq 195317 scn 9513178553945 found to restore
RMAN-06025: no backup of log thread 1 seq 195316 scn 9513178545850 found to restore
RMAN-06025: no backup of log thread 1 seq 195315 scn 9513178506636 found to restore
RMAN-06025: no backup of log thread 1 seq 195314 scn 9513178504655 found to restore
RMAN-06025: no backup of log thread 1 seq 195313 scn 9513178502956 found to restore
RMAN-06025: no backup of log thread 1 seq 195312 scn 9513178499499 found to restore
RMAN-06025: no backup of log thread 1 seq 195311 scn 9513178462055 found to restore
RMAN-06025: no backup of log thread 1 seq 195310 scn 9513178459671 found to restore
RMAN-06025: no backup of log thread 1 seq 195309 scn 9513178457766 found to restore
RMAN-06025: no backup of log thread 1 seq 195308 scn 9513178455989 found to restore
RMAN-06025: no backup of log thread 1 seq 195307 scn 9513178437688 found to restore
RMAN-06025: no backup of log thread 1 seq 195306 scn 9513178434194 found to restore
RMAN-06025: no backup of log thread 1 seq 195305 scn 9513178408127 found to restore
RMAN-06025: no backup of log thread 1 seq 195304 scn 9513178406180 found to restore
RMAN-06025: no backup of log thread 1 seq 195303 scn 9513178404599 found to restore
RMAN-06025: no backup of log thread 1 seq 195302 scn 9513178357609 found to restore
RMAN-06025: no backup of log thread 1 seq 195301 scn 9513178354332 found to restore
RMAN-06025: no backup of log thread 1 seq 195300 scn 9513178352262 found to restore
RMAN-06025: no backup of log thread 1 seq 195299 scn 9513178350260 found to restore
RMAN-06025: no backup of log thread 1 seq 195298 scn 9513178345591 found to restore
MAN-06025: no backup of log thre
RMAN> exit
恢复自动停止,数据库打不开。发现datafile异常
select file#,status
from v$datafile;
1 SYSTEM
2 ONLINE
3 ONLINE
4 ONLINE
5 ONLINE
6 ONLINE
7 ONLINE
8 ONLINE
9 ONLINE
10 ONLINE
11 ONLINE
12 ONLINE
13 ONLINE
14 SYSTEM
15 ONLINE
16 ONLINE
17 ONLINE
18 ONLINE
19 ONLINE
20 ONLINE
21 ONLINE
22 ONLINE
23 ONLINE
24 ONLINE
25 ONLINE
26 ONLINE
27 ONLINE
28 ONLINE
29 ONLINE
30 ONLINE
31 ONLINE
32 ONLINE
33 ONLINE
34 ONLINE
35 ONLINE
36      OFFLINE
37 ONLINE
四、修改了pfile两个参数开始恢复:
*._allow_terminal_recovery_corruption=true
*._allow_resetlogs_corruption= TRUE
 
SQL> recover database using backup controlfile;
ORA-00279: change 9513219033290 generated at 07/23/2012 04:00:51 needed for
thread 1
ORA-00289: suggestion : /u01/arch01/1_195369.dbf
ORA-00280: change 9513219033290 for thread 1 is in sequence #195369

Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log '/u01/arch01/1_195369.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

ORA-00308: cannot open archived log '/u01/arch01/1_195369.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
[oracle@new0 backup]$ cd /u01/arch01
[oracle@new0 arch01]$ ls
[oracle@new0 arch01]$ rman
Recovery Manager: Release 9.2.0.6.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
RMAN> connect target /
connected to target database: ITOWN01M (DBID=2826132969)

RMAN> restore archivelog from sequence 195369 until sequence 195374;
Starting restore at 31-JUL-12
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=11 devtype=DISK
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=195369
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=195370
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=195371
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=195372
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=195373
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=195374
channel ORA_DISK_1: restored backup piece 1
piece handle=/opt/oracle/backup/itown01_20120723_9909_1.arc tag=TAG20120723T050953 params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 31-JUL-12
RMAN> exit

Recovery Manager complete.
[oracle@new0 arch01]$ ls
1_195369.dbf  1_195370.dbf  1_195371.dbf  1_195372.dbf  1_195373.dbf  1_195374.dbf
[oracle@new0 arch01]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.6.0 - Production on Tue Jul 31 11:15:28 2012
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
SQL> connect / as sysdba
Connected.
SQL> recover database using backup controlfile;
ORA-00279: change 9513219033290 generated at 07/23/2012 04:00:51 needed for
thread 1
ORA-00289: suggestion : /u01/arch01/1_195369.dbf
ORA-00280: change 9513219033290 for thread 1 is in sequence #195369

Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 9513245274971 generated at 07/23/2012 05:06:51 needed for
thread 1
ORA-00289: suggestion : /u01/arch01/1_195370.dbf
ORA-00280: change 9513245274971 for thread 1 is in sequence #195370
ORA-00278: log file '/u01/arch01/1_195369.dbf' no longer needed for this
recovery

ORA-00279: change 9513245275649 generated at 07/23/2012 05:09:45 needed for
thread 1
ORA-00289: suggestion : /u01/arch01/1_195371.dbf
ORA-00280: change 9513245275649 for thread 1 is in sequence #195371
ORA-00278: log file '/u01/arch01/1_195370.dbf' no longer needed for this
recovery

ORA-00279: change 9513245275711 generated at 07/23/2012 05:09:50 needed for
thread 1
ORA-00289: suggestion : /u01/arch01/1_195372.dbf
ORA-00280: change 9513245275711 for thread 1 is in sequence #195372
ORA-00278: log file '/u01/arch01/1_195371.dbf' no longer needed for this
recovery

ORA-00279: change 9513245275714 generated at 07/23/2012 05:09:51 needed for
thread 1
ORA-00289: suggestion : /u01/arch01/1_195373.dbf
ORA-00280: change 9513245275714 for thread 1 is in sequence #195373
ORA-00278: log file '/u01/arch01/1_195372.dbf' no longer needed for this
recovery

ORA-00279: change 9513245275718 generated at 07/23/2012 05:09:52 needed for
thread 1
ORA-00289: suggestion : /u01/arch01/1_195374.dbf
ORA-00280: change 9513245275718 for thread 1 is in sequence #195374
ORA-00278: log file '/u01/arch01/1_195373.dbf' no longer needed for this
recovery

ORA-00279: change 9513245275721 generated at 07/23/2012 05:09:53 needed for
thread 1
ORA-00289: suggestion : /u01/arch01/1_195375.dbf
ORA-00280: change 9513245275721 for thread 1 is in sequence #195375
ORA-00278: log file '/u01/arch01/1_195374.dbf' no longer needed for this
recovery

ORA-00308: cannot open archived log '/u01/arch01/1_195375.dbf'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3

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

SQL> alter database open resetlogs;
Database altered.
SQL>
数据库打开了,数据没有丢失。

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

转载于:http://blog.itpub.net/26870952/viewspace-739451/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值