3 Replies Latest reply: Apr 12, 2013 1:51 PM by 879152 RSS

    Switchover between primary RAC and standby single instance

    Neo-b
      Hello All,

      I am using Oracle 11gR2.

      I am trying to do a switch over between primary database (RAC 2 nodes) and physical standby (single instance)

      If my Primary is single instance i was following the below steps:
      On the standby
      ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
      
      On the primary database:
      alter database commit to switchover to standby with session shutdown;
      shutdown immediate;
      startup nomount;
      alter database mount standby database;
      
      On the standby again:
      
      alter database commit to switchover to primary WITH SESSION SHUTDOWN;
      
      On the new standby:
      
      ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
      now, and since my primary is RAC when i am trying switch over I am getting the below error:
      SQL> alter database commit to switchover to standby with session shutdown;
      alter database commit to switchover to standby with session shutdown
      *
      ERROR at line 1:
      ORA-01105: mount is incompatible with mounts by other instances
      Plus that when I want to apply the remaining steps (below step), should I do it on each instance alone? or is there anyway to do it using the srvctl command:
       
      alter database mount standby database;
      Regards,
        • 1. Re: Switchover between primary RAC and standby single instance
          FreddieEssex
          Are all primary instances shutdown apart from the one where you are issuing your switchover command?
          • 2. Re: Switchover between primary RAC and standby single instance
            mseberg
            I agree.

            On the primary stop all but one instance (as stated by 11gR2 documentation)

            srvctl stop instance -d ...

            Quote ( source - Page 15 MAA - Switchover and Failover Best Practices )

            If the production and standby databases are in an Oracle RAC configuration, first shutting down all but one of the production instances. Once the primary
            database has only one instance up then shut down all standby instances except the apply instance (this will leave a single instance running on each cluster).


            Best Regards

            mseberg
            • 3. Re: Switchover between primary RAC and standby single instance
              879152
              Hi,

              Since You are using 2 node RAc as primary, so for switchover operation you need to shutdown
              one database instance( Suppose instance 2).

              Suppose your node1:
              hostname is dcpdb1
              and node 2:
              hostname is dcpdb2

              and standby hostname is drpdb1

              So follow this steps for switchover .

              How to Switchover from Primary to Standby Database?

              Process:

              On the primary server, check the latest archived redo log and force a log switch.


              *########### Login dcpdb1 as Oracle user #########*

              SQL> SELECT sequence#, first_time, next_time
              FROM v$archived_log
              ORDER BY next_time;
              SQL> ALTER SYSTEM SWITCH LOGFILE;


              Check the new archived redo log has arrived at the standby server and been applied.

              *########### Login drpdb1 as Oracle user #########*

              SQL> SELECT sequence#, first_time, next_time, applied
              FROM v$archived_log
              ORDER BY next_time ;

              *########### Login dcpdb2 as Oracle user #########*

              SQL> SELECT sequence#, first_time, next_time
              FROM v$archived_log
              ORDER BY next_time ;

              SQL> ALTER SYSTEM SWITCH LOGFILE;

              Check the new archived redo log has arrived at the standby server and been applied.


              *########### Login drpdb1 as Oracle user #########*

              SQL> SELECT sequence#, first_time, next_time, applied
              FROM v$archived_log
              ORDER BY next_time ;


              *########### Login dcpdb1 as Oracle user #########*

              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              TO STANDBY

              *########### Login dcpdb2 as Oracle user #########*

              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              TO STANDBY

              *########### Login drpdb1 as Oracle user #########*


              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              NOT ALLOWED

              *########### Login dcpdb2 as Oracle user #########*


              SQL> shutdown immediate
              Database closed.
              Database dismounted.
              ORACLE instance shut down.
              SQL>

              *########### Login dcpdb1 as Oracle user #########*

              SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN;

              Database altered.

              SQL>
              SQL> shutdown immediate
              ORA-01507: database not mounted
              ORACLE instance shut down.
              SQL>



              SQL> startup mount
              ORACLE instance started.
              Total System Global Area 1.5400E+10 bytes
              Fixed Size 2184872 bytes
              Variable Size 7751076184 bytes
              Database Buffers 7616856064 bytes
              Redo Buffers 29409280 bytes
              Database mounted.
              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              TO PRIMARY

              SQL>


              *########### Login drpdb1 as Oracle user #########*

              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              SESSIONS ACTIVE

              SQL> alter database commit to switchover to primary with session shutdown;

              Database altered.

              SQL> shutdown immediate
              ORA-01109: database not open
              Database dismounted.
              ORACLE instance shut down.
              SQL>
              SQL> startup
              ORACLE instance started.
              Total System Global Area 1.5400E+10 bytes
              Fixed Size 2184872 bytes
              Variable Size 7717521752 bytes
              Database Buffers 7650410496 bytes
              Redo Buffers 29409280 bytes
              Database mounted.
              Database opened.



              *########### Login dcpdb1 as Oracle user #########*

              SQL> alter database open read only;

              Database altered.

              SQL> alter database recover managed standby database using current logfile disconnect;

              Database altered.


              *########### Login dcpdb2 as Oracle user #########*

              SQL> startup mount
              ORACLE instance started.

              Total System Global Area 1.5400E+10 bytes
              Fixed Size 2184872 bytes
              Variable Size 7751076184 bytes
              Database Buffers 7616856064 bytes
              Redo Buffers 29409280 bytes
              Database mounted.
              SQL> alter database open read only;

              Database altered.

              SQL> alter database recover managed standby database using current logfile disconnect;

              Database altered.

              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              NOT ALLOWED

              SQL>



              *########### Login drpdb1 as Oracle user #########*

              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              TO STANDBY

              *########### Login dcpdb1 as Oracle user #########*

              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              NOT ALLOWED

              SQL>


              *########### Login dcpdb2 as Oracle user #########*


              SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;

              SWITCHOVER_STATUS
              --------------------
              NOT ALLOWED

              SQL>

              *####################### Finish SwitchOver ########################*

              Check

              *########### Login drpdb1 as Oracle user #########*


              SQL> alter system switch logfile;

              SQL>
              SELECT sequence#, first_time, next_time
              FROM v$archived_log
              ORDER BY sequence#;

              SQL> archive log list

              *########### Login dcpdb1 as Oracle user #########*

              SQL>
              SELECT sequence#, first_time, next_time, applied
              FROM v$archived_log
              ORDER BY sequence#;

              SQL> archive log list



              *########### Login dcpdb2 as Oracle user #########*

              SQL>
              SELECT sequence#, first_time, next_time, applied
              FROM v$archived_log
              ORDER BY sequence#;


              SQL> archive log list

              Thanks
              Solaiman

              Edited by: 876149 on Apr 12, 2013 11:51 AM