oracle ora 01152,ORA-01152 故障解决

今天在测试库上做RMAN备份恢复实验时,open resetlogs阶段出现了错误:

ORA-01152: file 1 was not restored from a sufficiently old backup

ORA-01110: data file 1: '/opt/oracle/oradata/dbp/system01.dbf'

突然想起以前在此库做过一个RMAN configuration(备份时exclude system tablespace),应该是因此恢复时才会提示报错。

如下恢复步骤:

set DBID

restore spfile from.

restore controlfile from.

RMAN> restore database;

Starting restore at 29-MAR-12

using channel ORA_DISK_1

using channel ORA_DISK_2

file 7 is excluded from whole database backup

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

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

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

RMAN-03002: failure of restore command at 03/29/2012 14:16:17

RMAN-06026: some targets not found - aborting restore

file 7 is excluded from whole database backup

restore not done;

从此处可以看出,实际上restore 就没有完成。

RMAN>

run{

set until scn 61182896;

restore database;

restore archivelog all;

recover database;

alter database open resetlogs;}

……………………………………………………………………

allocated channel: c1

channel c1: sid=13 devtype=DISK

Starting restore at 02-AUG-05

released channel: c1

…………………………………………………………

RMAN-06026: some targets not found - aborting restore

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

RMAN> alter database open resetlogs;

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

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

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

RMAN-03002: failure of alter db command at 03/29/2012 15:50:21

ORA-01152: file 1 was not restored from a sufficiently old backupORA-01110: data file 1: '/opt/oracle/oradata/dbp/system01.dbf'

RMAN> list incarnation ;

List of Database Incarnations

DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time

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

1       1       DBP      1761361519       PARENT  1          17-FEB-08

2       2       DBP      1761361519       PARENT  464631     21-JUN-10

3       3       DBP      1761361519       PARENT  579893     28-JUN-10

4       4       DBP      1761361519       PARENT  1116645    14-AUG-10

5       5       DBP      1761361519       CURRENT 1117950    14-AUG-10

6       6       DBP      1761361519       ORPHAN  19093809   04-JAN-12

7       7       DBP      1761361519       ORPHAN  61604278   26-MAR-12

当restore 单个datafile 时,也有报错

ORA-01178: file 7 created before last CREATE CONTROLFILE, cannot recreate

解决方法:重建控制文件

SQL> shutdown immediate

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

SQL> SQL> SQL>

SQL> startup nomount;

ORACLE instance started.

Total System Global Area 1073741824 bytes

Fixed Size            1271616 bytes

Variable Size          297797824 bytes

Database Buffers      767557632 bytes

Redo Buffers            7114752 bytes

SQL>CREATE CONTROLFILE REUSE DATABASE "DBP" RESETLOGS  ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 '/opt/oracle/oradata/dbp/redo01.log'  SIZE 50M,

GROUP 2 '/opt/oracle/oradata/dbp/redo02.log'  SIZE 50M,

GROUP 3 '/opt/oracle/oradata/dbp/redo03.log'  SIZE 50M

DATAFILE

'/opt/oracle/oradata/dbp/system01.dbf',

'/opt/oracle/oradata/dbp/undotbs01.dbf',

'/opt/oracle/oradata/dbp/sysaux01.dbf',

'/opt/oracle/oradata/dbp/users01.dbf',

'/opt/oracle/oradata/dbp/TOSS_WAPS_DATA.dbf',

'/opt/oracle/oradata/dbp/waps_data1.dbf',

'/opt/oracle/oradata/dbp/waps_data3.dbf'

19  ;

Control file created.

SQL> recover database until cancel using backup controlfile;

ORA-00279: change 61718297 generated at 03/29/2012 10:57:31 needed for thread 1

ORA-00289: suggestion : /opt/oracle/flash_recovery_area/1_12_778932065.dbf

ORA-00280: change 61718297 for thread 1 is in sequence #12

Specify log: {=suggested | filename | AUTO | CANCEL}

connected.

SQL> startup force

ORACLE instance started.

Total System Global Area 1073741824 bytes

Fixed Size            1271616 bytes

Variable Size          297797824 bytes

Database Buffers      767557632 bytes

Redo Buffers            7114752 bytes

Database mounted.

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;

Database altered.

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

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值