This discussion is archived
6 Replies Latest reply: Jul 25, 2012 1:13 PM by mseberg RSS

Attempting simple Oracle 11gR2 DataGuard Failback

575696 Newbie
Currently Being Moderated
Hi,

I am attempting to do an Oracle 11gR2 Data Guard Failback.

I am attempting to do a failback using Flashback

I am following the documentation here.

13.2 Converting a Failed Primary Into a Standby Database Using Flashback Database
http://docs.oracle.com/cd/E11882_01/server.112/e17022/scenarios.htm#i1049997

Where I am stuck is here.

Step 4 Start transporting redo to the new physical standby database.
3.Perform a log switch
SQL> ALTER SYSTEM SWITCH LOGFILE;

But when, I try to to a logswitch on my 'former primary ( and to re-be primary again )'
I get an unexpected result.

******************

SQL> ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE
*
ERROR at line 1:
ORA-01109: database not open

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 NORESETLOGS;
ALTER DATABASE OPEN NORESETLOGS
*
ERROR at line 1:
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

************************

Then, I stopped. "ALTER DATABASE OPEN RESETLOGS;" is not in the documentation
and this does not seem right.

What am I doing wrong?
Please help?

One thing that I am possibly thinking is that when I
performed on the 'old primary ( to be standby again)'

*******************

ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

********************

that the 'original primary ( failback target ) should have been OPEN ( not MOUNTed )'
but the docs did not say that.

Any help?

Thank you,
Andre
  • 1. Re: Attempting simple Oracle 11gR2 DataGuard Failback
    mseberg Guru
    Currently Being Moderated
    Andre;




    OK Step 4 ( Step 4 Start transporting redo to the new physical standby database.)

    h3. Question

    Are you doing this command from the New primary ( the old standby ? )

    ALTER SYSTEM SWITCH LOGFILE;
    that the 'original primary ( failback target ) should have been OPEN ( not MOUNTed )'
    Not true. Is it possible you missed something in step 3??

    So on the failed primary database ( this goes back to step 2 )

    1. SHUTDOWN IMMEDIATE;
    2. STARTUP MOUNT;
    3. FLASHBACK DATABASE TO SCN ( to the number you got in step 1 from the NEW Primary DB )
    4. ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
    5. SHUTDOWN IMMEDIATE;
    6. STARTUP MOUNT;


    So Step 4 is on the Old Standby, the New Primary that you failover to.

    For additional information see :

    Step by Step Guide on How To Reinstate Failed Primary Database into Physical Standby [ID 738642.1]

    My test document on this :

    http://www.visi.com/~mseberg/Data_Guard_Failover_Test_using_SQL.pdf

    Best Regards

    mseberg
  • 2. Re: Attempting simple Oracle 11gR2 DataGuard Failback
    575696 Newbie
    Currently Being Moderated
    mseberg,

    O.K. I read your linked articles.

    I guest another, follow up is the question.

    If I do failback to the original primary, may I yet-again a re-failover to the standby?

    May I do this 're-failover to the standby' without re-going through a primary site re-creaton ( and manual physical transfer ) of a standby controlfile? Or, do I have to do a massive re-start of the massive re-setup of the primary-standby system all over again?
  • 3. Re: Attempting simple Oracle 11gR2 DataGuard Failback
    mseberg Guru
    Currently Being Moderated
    OK

    So you failover to your standby ( New Primary )

    You reinstate your old Primary ( New Standby )

    You make sure they sync and then you do a switchover and the Primary is the Primary again and the Standby is Standby.
    If I do failback to the original primary, may I yet-again a re-failover to the standby?
    Once the databases are in sync you can do a failover again. It will not matter which database is in the Primary role, only that they are in sync.

    Since you use reinstate to bring up an old primary as a new standby you do not have to recreate the standby control file or any re-setup of data guard.

    Reinstate bring the new standby back at the SCN where the failover occurred so once you have that and your setup was correct in the first place the sync should be moments away.

    Once you have sync you can failover. Would always setup with FRA, but you can reinstate with RMAN too.

    Additional Info

    Reinstating a Physical Standby Using Backups Instead of Flashback [ID 416310.1]

    Using RMAN Effectively In A Dataguard Environment. [ID 848716.1]

    Best Regards

    mseberg

    Edited by: mseberg on Jul 25, 2012 11:02 AM
  • 4. Re: Attempting simple Oracle 11gR2 DataGuard Failback
    user10697869 Newbie
    Currently Being Moderated
    As long as you have have flashback enabled, re-instating old primary is easy.
    generally, you do failover in unplanned DR and switchover in planned DR.

    if the gap between old primary and new primary is large, then use RMAN incremental backups.
  • 5. Re: Attempting simple Oracle 11gR2 DataGuard Failback
    575696 Newbie
    Currently Being Moderated
    Well,

    According to an 11g book I have

    after

    SQL> flashback database to scn ########;

    then later some expected statements are the following.

    SQL> shutdown immediate;
    SQL> startup mount;
    SQL> alter database open resetlogs;

    Since, these are test instances ( and I have cold backups ), I will JUST TRY IT,
    and see what happens. That is, see if I need to resetup (at least some) parts of dataguard.

    I will report back here.

    If after a failback, if anyone knows whether or not I need to resetup ( at least some ) parts of dataguard, I would appreciate the clue.

    Thanks.

    Andre
  • 6. Re: Attempting simple Oracle 11gR2 DataGuard Failback
    mseberg Guru
    Currently Being Moderated
    Andre;
    if anyone knows whether or not I need to resetup ( at least some ) parts of dataguard, I would appreciate the clue.
    The answer is No. Guarantee - if your setup is correct you will not change any part of it because of failover or switchover.


    h3. Later

    Failover will NOT change the following pieces of Data Guard setup :

    Forced logging
    The Oracle password file
    The tnsnames.ora on any server
    The Listener setup for Data Guard
    The Spfiles
    The Standby Redo Logs
    Archiving mode



    The only things that change are

    Which database is in Primary mode
    And what the last SCN applied on the "Former primary is"


    You correct the SCN ( generally ) by

    SQL> FLASHBACK DATABASE TO SCN    <YOUR_NUMBER_HERE>
    Once this is done the database should sync and the only difference is they are in opposite roles. No setup changes needed.

    h3. No setup changes needed after failover.


    Best Regards

    mseberg

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points