2 Replies Latest reply: Aug 31, 2010 9:42 AM by Hungry DBA RSS

    steps to do switchover / switchback in RAC environment

    Hungry DBA
      Hi folks,

      I m having setup with 2 node RAC primary and 2 node RAC Dataguard on 10.2.0.4.0. Dataguard setup is working fine. Dataguard is setup with Standby Redo log group with managed recovery. There is no problem with transferring archives & applying on standby.

      Now I want to do Switchover/Switchback between Primary and Standby for RAC. I am familiar with Single instance Switchover and Switchback but never did RAC environment Switchover/Switchback. Can anybody please elaborate steps or suggest any link for me??

      regards,
      manish
        • 1. Re: steps to do switchover / switchback in RAC environment
          Sebastian Solbach -Dba Community-Oracle
          Hi Manish,
          there are some good whitepapers on the MAA website of Oracle:

          http://www.oracle.com/technology/deploy/availability/htdocs/maa.htm

          The best for your situation is probably these two:

          http://www.oracle.com/technology/deploy/availability/pdf/MAA_WP_10gR2_SwitchoverFailoverBestPractices.pdf
          http://www.oracle.com/technology/deploy/availability/pdf/dataguard11g_rac_maa.pdf

          Regards
          Sebastian
          • 2. Re: steps to do switchover / switchback in RAC environment
            Hungry DBA
            Hi Guys,

            Today I performed RAC Switchover / Switchback for 2 Node Primary with 2 Node Standby on OEL. I expected some issues, but it was totally smooth. Giving you steps for the same, so it will be useful to you. Even this would be my first contribution to Oracle Forums.

            DB Name     DB Unique Name     Host Name     Instance Name
            --------------------------------------------------------------------------------------
            live     live     linux1     live1
            live     live     linux2     live2
            live     livestdby     linux3     livestdby1
            live     livestdby     linux4     livestdby2


            Verify that each database is properly configured for the role it is about to assume and the standby database is in mounted state.
            (Verify all Dataguard parameters on each node for Primary & Standby)

            Like,
            Log_archive_dest_1
            Log_archive_dest_2
            Log_archive_dest_state_1
            Log_archive_dest_state_2
            Fal_client
            Fal_server
            Local_listener
            Remote_listener
            Standby_archive_Dest
            Standby_archive_management
            service_names
            db_unique_name
            instance_name
            db_file_name_convert
            log_file_name_convert

            Verify that both Primary RAC & Dataguard RAC are functioning properly and both are in Sync
            On Primary,
            Select thread#,max(sequence#) from v$archived_log group by thread#;
            On Standby,
            Select thread#,max(sequence#) from v$log_history group by thread#;

            Before performing a switchover from a RAC primary shut down all but one primary instance (they can be restarted after the switchover has completed).
            ./srvctl stop instance –d live –i live1
            Before performing a switchover or a failover to a RAC standby shut down all but one standby instance (they can be restarted after the role transition has completed).
            ./srvctl stop instance –d live –i livestdby1

            On the primary database initiate the switchover:
            alter database commit to switchover to physical standby with session shutdown;
            Shutdown former Primary database & Startup in Mount State.
            Shut immediate;
            Startup mount;
            select name,db_unique_name, log_mode,open_mode,controlfile_type,switchover_status,database_role from v$database;

            Make log_Archive_Dest_state_2 to DEFER
            alter system set log_archive_dest_state_2='DEFER' sid='*';

            On the (old) standby database,
            select name,log_mode,open_mode,controlfile_type,switchover_status,database_role from v$database;

            On the (old) standby database switch to new primary role:
            alter database commit to switchover to primary;
            shut immediate;
            startup;

            On new Primary database,
            select name,log_mode,open_mode,controlfile_type,switchover_status,database_role from v$database;
            Make log_Archive_Dest_state_2 to ENABLE
            alter system set log_archive_dest_state_2='ENABLE' sid='*';
            Add tempfiles in New Primary database.
            Do some archivelog switches on new primary database & verify that archives are getting transferred to Standby database.

            On new primary,
            select error from v$archive_Dest_status;
            select max(sequence#) from v$archived_log;

            On new Standby, Start Redo Apply

            alter database recover managed standby database using current logfile disconnect;

            Select max(sequence#) from v$log_history; (should be matching with Primary)



            Now Start RAC databases services (both Primary – in open & Standby – in mount)
            On new Primary Server.
            ./srvctl start instance –d live –i livestdby2
            Verify using ./crs_stat –t
            Check that database is opened in R/W mode.
            On new Standby Server.      
            ./srvctl start instance –d live –i live2 –o mount

            Now add TAF services on new Primary (former Standby) Server.
            By Command Prompt,
            ./srvctl add service -d live -s srvc_livestdby -r livestdby1,livestdby2 -P BASIC
            OR
            By GUI,
            dbca -> Oracle Read Application Cluster database -> Service Management -> select database -> add services, details (Preferred / Available), TAF Policy (Basic / Preconnect) - > Finish

            Start the services,
            ./srvctl start service -d live

            Verify the same,
            ./crs_stat -t

            Perform TAF testing, to make sure Load Balancing & Failover.


            regards,
            manish

            Email: manish.nashikkar@hotmail.com

            Edited by: Manish Nashikkar on Aug 31, 2010 7:41 AM

            Edited by: Manish Nashikkar on Aug 31, 2010 7:42 AM