clicksor ad

Tuesday, January 31, 2006

Standby archive apply throws error ORA-01152

This is what happened today .I tried to restore a cold backup of the primary on the standby and started it with a backup normal controlfile.
alter database mount standby database ;
controlfile is not standby controlfile
so I went to the primary and took a controlfile backup
alter database create standby controlfile as '/bkp/standby.ctl';
and ftp 'ed it to the standby

Then I started the database ,note that the cold backup had taken a weeks time to reach the standby location;
startup nomount
alter database mount standby database;
recover standby database;

ORA-00279: change 1494548083 generated at 01/30/2006 14:44:34 needed for thread 2
ORA-00289: suggestion : /arch/log/2_531.dbf
ORA-00280: change 1494548083 for thread 2 is in sequence #531
Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 1494548083 generated at 01/26/2006 08:54:44 needed for thread 1
ORA-00289: suggestion : /arch/log/1_361.dbf
ORA-00280: change 1494548083 for thread 1 is in sequence #361
Specify log: {=suggested | filename | AUTO | CANCEL}

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

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: '/bkp/oradata/orcl_raw_system01'

So what I did was goto the primary switch logfiles for a few times and ftp all those archive logs to the standby and apply them .The SCN number on the controlfile and the datafile did not sync that is why this error is coming.
The SCN that should update the controlfile is still in the online redo log when I took a backup of the controlfile (Primary was open) ,but the datafile was updated with the available archive log and has advanced ahead of the controlfile.hmmm!!!

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

ORA-00279: change 1495167055 generated at 02/01/2006 09:47:17 needed for thread
1
ORA-00289: suggestion : /arch/log/1_367.dbf
ORA-00280: change 1495167055 for thread 1 is in sequence #367
ORA-00278: log file '/arch/log/1_366.dbf' no longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open read only;

Database altered.

SQL>

No comments: