2 Replies Latest reply: Apr 30, 2014 8:02 AM by mseberg RSS

    Switch roles between primary and physical standby

    misterimran

      Dear All,

       

      As a part of business continuity management, I have been given a task to switch roles between primary and physical standby database.

       

      We have Oracle 10gR2 on windows 2003 OS. Physical standby is synced using shipped archive logs from primary database.

       

      To test and check working of physical standby. I want to make physical standby primary, check its connectivity from applications, user may perform some DML in between and then i have to revert everything to its original state.

       

      Is there any helping docuemnt available for this. I am not using data guard broker.

       

      Regards, Imran

        • 1. Re: Switch roles between primary and physical standby
          FreddieEssex

          You can either do a manual switchover during which time your databases will switch roles.  You can do your testing etc and then do a a switchover again to resume your original configuration.  Bear in mind with this method any changes you make on your DR site will be replicated back to your standby site.

          http://www.oracle-base.com/articles/9i/data-guard.php#DatabaseSwitchover

           

          If you want to revert your primary to exactly the way it was you have two options:

           

          1) Activate the standby and once testing is complete rebuild the standby using RMAN or whatever method you choose.

          http://www.oracle-base.com/articles/9i/data-guard.php#DatabaseFailover

           

          2) Use flashback once you are finished on the standby.  Below is the procedure I use, but there is bound to be other documentation out there.

          Defer log shipping on the primary

          alter system set log_archive_dest_state_2=defer scope=memory;

          On the standby:

          alter database recover managed standby database cancel;

          create restore point before_dr guarantee flashback database;

          select name, scn, time, database_incarnation#, guarantee_flashback_database,storage_size from v$restore_point;

          alter database recover managed standby database finish;

          alter database activate physical standby database;

          After testing is complete revert this back to being a standby:

          shutdown immediate

          startup mount

          flashback database to restore point before_dr;

          alter database convert to physical standby;

          shutdown immediate

          startup nomount

          alter database mount standby database;

          alter database recover managed standby database using current logfile disconnect;

          drop restore point before_dr;

          Enable log shipping from the primary:

          alter system set log_archive_dest_state_2=ENABLE scope=both;

          I have db_recovery_file_dest set on the standby and the database does NOT need to have flashback enabled and will stilll generate the flashback logs.

           

          My advice would be to test this out on an environment and ensure you are comfortable with the procedure and before you do anything on your production environment.  Also ensure you have enough space to hold your flashback logs which will be dependant on how much testing you will be doing on your standby site.  Make sure you drop your restore point afterwards especially if you use guaranteed restore points.

          • 2. Re: Switch roles between primary and physical standby
            mseberg

            Hello;

             

            Nothing new here, but here are my notes for Oracle 10:

             

            http://www.visi.com/~mseberg/data_guard/Data_Guard_switchover.html

             

            Freddie nailed it, test, test, test.

             

            Best Regards

             

            mseberg