News
Perth, Australia
+ (61) 417713124
prosolutions@gavinsoorma.com

Using FLASHBACK after a Data Guard Failover

  • Posted by Gavin Soorma
  • On June 28, 2009
  • 0 Comments
Original Data Guard Environment

HQLINUX05 - PRIMARY
ITLINUX03 - STANDBY.

Perform FAILOVER TO ITLINUX03 (now the new Primary)

Next in ITLINUX03 .....

Step 1: On the new primary, run the following query to determine at what SCN it became
the new primary.

bozo:/u01/ORACLE/bozo> sql

SQL*Plus: Release 10.1.0.2.0 - Production on Mon May 9 14:48:57 2005

Copyright (c) 1982, 2004, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select to_char(standby_became_primary_scn) from v$database;
TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)
----------------------------------------
385053

Step2: Bring the old primary database to the mount state and flashback to SCN retrieved in Step 1.

Go to original primary machine (HQLINUX05)…

SQL>
 shutdown immediate;
 startup mount;
 flashback database to scn 387774;

Flashback complete.

Step3:
SQL> alter database flashback off;  - since flashback logs are no more valid.

Step4:

On the old primary(hqlinux05), create a standby controlfile

SQL>alter database create standby controlfile as '/tmp/standby1.ctl';

Step 5:

SQL>Shutdown immediate;

Copy the standby control file to the control_files location in the init.ora(hqlinux05)
which is the original primary.

rename the standby controlfile standby1.ctl to match the names of the control files
as defined in the control_files parameter in the init.ora.

Step 6:

SQL> Startup mount;

SQL> Alter database flashback on;

On the new primary(itlinux03) enable log shipping…

SQL> alter system set log_archive_dest_state_2=ENABLE  scope=both;

On the new standby/old primary start managed recovery - (hqlinux05)


SQL> Alter database recover managed standby database disconnect;
 

0 Comments

Leave Reply

Your email address will not be published. Required fields are marked *