Re: Oracle 8i, copy database on new server and replay redologs

From: RB <burton.rob_at_gmail.com>
Date: Fri, 10 Jul 2009 03:03:32 -0700 (PDT)
Message-ID: <6eb3b07c-2580-4cce-a9a8-44beca527320_at_h8g2000yqm.googlegroups.com>



On Jul 8, 6:35 pm, Fabrice <t..._at_test.com> wrote:
> Hello,
>
> I have an Oracle database 8i on a Win2003 Server (named SRV1).
> The database is in archive log mode.
>
> The backup is done with :
>
> - a "cold backup" every night by the copy of all the files : all the dbf
> datafiles, control files, redolog file and init file.
>
> - There are two exports by day with the tool EXP.
>
> I have an another server (sort of backup server) named SRV2 with the same
> installation of Oracle 8i ; The same instance name, the same paths for the
> files : .dbf, .ctl, redo and init.ora .
>
> I can copy all the files of my cold backup from SRV1 to my second server
> SRV2 and start the instance with the commande : ALTER DATABASE OPEN
> RESETLOGS; In this case I have my database in state of the last cold
> backup.
>
> My question is : Can I replay the archived redologs of the day ?
>
> Explanation :
>
> - I have a cold backup of the last night : 01h00 AM.
> - My production base crash at 12h00 PM.
> - From 01h00 AM to 12h00 PM, 20 redologs have been archived and save on a
> network share.
>
> --> If I copy my cold backup (from 01h00) on the second server SRV2 and all
> the archived redo logs to this server (20 files) can tell to Oracle to
> replay the archived logs on the cold backup before open it ?
> I have tried to do a recover database but nothing happen.
>
> Is it possible to do it ?
> Thanks a lot
> Fabrice

Fabrice, recovering the archive logs in this situation should be straightforward by doing an incomplete recovery before opening the database.

  1. Restore the cold backup to the 2nd server (You don't need to restore the redo logs as they are from before the time you want to recover to). Also restore the archive logs you want to restore to the correct location.
  2. startup the database - It will fail because of the lack of redo logs.
  3. Issue - recover database using backup controlfile until cancel; (You can't use your current controlfile as again it comes from before the archivelogs and the cold backup doesn't need recovery) This will prompt you to apply the logs one at a time until you run out of logs to apply.
  4. alter database open resetlogs; (The database is now recovered up to the last archive log).

A cold backup together with exports for extra protection is a perfectly reasonable way to back up a database. In later versions of the database RMAN is definitely a preferred method though.

Rob..

This is an example from 10G XE but the recovery will be the same in your case.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open SQL> recover database using backup controlfile until cancel; ORA-00279: change 8931018840104 generated at 07/10/2009 10:26:29 needed for
thread 1
ORA-00289: suggestion :
/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/archivelog/ 2009_07_10/o1_mf
_1_213_%u_.arc
ORA-00280: change 8931018840104 for thread 1 is in sequence #213

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

ORA-00279: change 8931018840198 generated at 07/10/2009 10:29:23 needed for
thread 1
ORA-00289: suggestion :
/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/archivelog/ 2009_07_10/o1_mf
_1_214_%u_.arc
ORA-00280: change 8931018840198 for thread 1 is in sequence #214 ORA-00278: log file
'/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/archivelog/ 2009_07_10/o1_m
f_1_213_55g2hmhk_.arc' no longer needed for this recovery

Specify log: {<RET>=suggested | filename | AUTO | CANCEL} ....
....
ORA-00308: cannot open archived log
'/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/archivelog/ 2009_07_10/o1_m
f_1_218_%u_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory Additional information: 3

SQL>
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. Received on Fri Jul 10 2009 - 05:03:32 CDT

Original text of this message