admin管理员组

文章数量:1122919

oracle ora 01152,ORA

今天在测试库上做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博客 ” ,链接:/,如需转载,请注明出处,否则将追究法律责任。

本文标签: oracle ora 01152ORA