6 Replies Latest reply: Nov 15, 2012 5:10 AM by mseberg RSS

    Question on Manual switchover in RAC

    Max
      Version : 11.2.0.3
      Platform: Solaris 11 (x86-64 )


      Our primary database is a 3-node RAC DB ----------------------------> SCAN name of Primary --> belktam1-scan.na.schmdcp.com
      Yesterday we've configured a 3-node RAC physical standby for this. ---> SCAN name of Standby --> belktam2-scan.na.schmdcp.com


      Now, we've asked the apps team to add the standby DB's SCAN name to their JDBC URL.

      JDBC URL:
      jdbc:oracle:thin:@ (DESCRIPTION_LIST=(LOAD_BALANCE=OFF)(FAILOVER=YES)(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=belktam1-scan.na.schmdcp.com)(PORT=3845)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=RDTB_PROD.na.schmdcp.com)))(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=belktam2-scan.na.schmdcp.com)(PORT=3845)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=RDTB_PROD.na.schmdcp.com))))
      Since the JDBC URL is long , i am giving you the TNS entry equivalent for the above JDBC ur more readability.

      TNS_EQUIVALENT =
      (DESCRIPTION_LIST=
         (LOAD_BALANCE=OFF) (FAILOVER=YES)
         (DESCRIPTION=
           (ADDRESS_LIST=
             (ADDRESS=(PROTOCOL=TCP)(HOST=belktam1-scan.na.schmdcp.com)(PORT=3845))
           )
           (CONNECT_DATA=
             (SERVER=DEDICATED)
             (SERVICE_NAME=RDTB_PROD.na.schmdcp.com)
           )
         )
         (DESCRIPTION=
           (ADDRESS_LIST=
             (ADDRESS=(PROTOCOL=TCP)(HOST=belktam2-scan.na.schmdcp.com)(PORT=3845))
           )
           (CONNECT_DATA=
             (SERVER=DEDICATED)
             (SERVICE_NAME= RDTB_PROD.na.schmdcp.com)
           )
         )
      )
      Question1 .
      Swithover will happen only through Manual intervention. After we do a switchover any new JDBC connection using the above URL will be connecting to the standby DB (whose role has switched to primary now) .Right ?


      Question2.
      After we do the switchover to standby, should the application be restarted. I know that SQL*Plus using the above tns entry will be connecting to the standby without any issues .


      Question2.
      Consider a scenario where no switchover is involved. During normal functioning of the Primary and Standby , due to a network issue
      the SCAN name at primary standby becomes unavailable for few minutes. Will the client sessions using the above URL try to connect to the standby DB ?
        • 1. Re: Question on Manual switchover in RAC
          mseberg
          Hello;
           Question1 .
          Swithover will happen only through Manual intervention. After we do a switchover any new JDBC connection using the above URL will be connecting to the standby DB (whose role has switched to primary now) .Right ?
          Correct.
          Question2.
          After we do the switchover to standby, should the application be restarted. I know that SQL*Plus using the above tns entry will be connecting to the standby without any issues .
          Only real way to know is to test.
          Consider a scenario where no switchover is involved. During normal functioning of the Primary and Standby , due to a network issue
          the SCAN name at primary standby becomes unavailable for few minutes. Will the client sessions using the above URL try to connect to the standby DB ?
          I'm thinking Yes. You can use DBMS_SERVICE.CREATE_SERVICE and a trigger to control this.

          Best Regards

          mseberg
          • 2. Re: Question on Manual switchover in RAC
            teits
            >
            Question2.
            Consider a scenario where no switchover is involved. During normal functioning of the Primary and Standby , due to a network issue
            the SCAN name at primary standby becomes unavailable for few minutes. Will the client sessions using the above URL try to connect to the standby DB ?
            seems visible! to avoid this consider mseberg suggestion
            use a trigger for the control.

            consider this posts...very good.
            http://uhesse.com/2009/08/19/connect-time-failover-transparent-application-failover-for-data-guard/

            HTH
            Tobi

            Edited by: teits on Nov 14, 2012 12:41 PM
            • 3. Re: Question on Manual switchover in RAC
              Max
              You can use DBMS_SERVICE.CREATE_SERVICE

              Isn't that a bit old-fashioned ? I think everyone uses
              srvctl add service
              these days.

              Although I worked with RAC for 3 years , I never used service. In my new shop , schema stacking is practised and the bright side is I got to work with RAC services feature.
              • 4. Re: Question on Manual switchover in RAC
                teits
                Max wrote:
                You can use DBMS_SERVICE.CREATE_SERVICE

                Isn't that a bit old-fashioned ? I think everyone uses
                srvctl add service
                these days.

                Although I worked with RAC for 3 years , I never used service. In my new shop , schema stacking is practised and the bright side is I got to work with RAC services feature.
                Its is not old-fashioned. i would use DBMS_SERVICE.CREATE_SERVICE
                reason: with DBMS_SERVICE.CREATE_SERVICE the changes are replicated by redo on standby. but with srvctl add service what will happen to standby DB?
                ---edited
                srvctl add service is very good options.
                Please read: http://docs.oracle.com/cd/E14072_01/server.112/e10702/sofo.htm#CHDBHJIB section:5.6.1.2 Database Service Configuration Requirements
                1. with srvctl you can configure a service to be active when in physical_standby role.
                2. you can configure the services to start after a role change.



                Tobi

                Edited by: teits on Nov 15, 2012 3:06 PM
                • 5. Re: Question on Manual switchover in RAC
                  Max
                  Ohhh... Just didn't think about it. Thanks Tobi.
                  • 6. Re: Question on Manual switchover in RAC
                    mseberg
                    Hello again;

                    Both of these are worth a look :

                    http://uhesse.com/2009/08/19/connect-time-failover-transparent-application-failover-for-data-guard/

                    Also interesting

                    Thread: How to rename the primary database instance after switchover

                    Re: How to rename the primary database instance after switchover

                    Best Regards

                    mseberg