12 Replies Latest reply: Feb 13, 2014 3:39 AM by Suntrupth RSS

    Switch to Standby DB

      Hi all,

       

      11.2.0.3

       

      We plan to test switching to our standby database. How do  our Standby server take over the IP of our Primary server? Is it manually changed?

       

       

      Thanks,

      pK

        • 1. Re: Switch to Standby DB
          sb92075

          >We plan to test switching to our standby database

          What does the Fine Manual state should be done?

          • 2. Re: Switch to Standby DB
            Suntrupth

            Are you talking about Switchover or Failover?

             

             

            Anyway, Simplest option would be to use a listener connect failover.

             

             

            The tnsnames.ora would look like:

             

             

            HA=

            (description=

            (address = (host = PROD)(protocol = tcp)(port = 1521))

            (address = (host = STANDBY)(protocol = tcp)(port = 1521))

            (failover = yes)

            (connect_data = (service_name = orcl))

             

             

            Just make sure only the listener at your present primary server is running

             

             

            Another option would be to change the database host name in the tnsnames.ora.

             

             

            (address = (host = PROD)(protocol = tcp)(port = 1521))

            to (address = (host = STANDBY)(protocol = tcp)(port = 1521))

             

            Regards,

            Suntrupth

            • 3. Re: Switch to Standby DB

              Thanks Sunny

               

              For me switchover and failover are just the same

              Can you tell me the difference?

               

              What we want to do is...we what to test our standby database if it gonna work, then after testing that it is working for a day or two, we will go back to the primary.

              We gonna do it on holyweek where there is less transactions?

               

              Thanks,

              • 4. Re: Switch to Standby DB
                Suntrupth

                A switchover is a role reversal between the primary database and one of its standby databases. A switchover guarantees no data loss and is typically done for planned maintenance of the primary system. During a switchover, the primary database transitions to a standby role, and the standby database transitions to the primary role.

                 

                 

                A failover is done when the primary database (all instances of an Oracle RAC primary database) fails or has become unreachable and one of the standby databases is transitioned to take over the primary role. Failover may or may not result in data loss depending on the protection mode in effect at the time of the failover.

                 

                 

                More details : http://docs.oracle.com/cd/E11882_01/server.112/e17023/sofo.htm#DGBKR330

                 

                 

                You can perform a switchover based on your requirement.

                 

                Regards,

                Suntrupth

                • 5. Re: Switch to Standby DB

                  Thanks Sunny,

                   

                  Yeah we wanted the switchover, the standby becomes primary and the primary becomes standby. I am confused how can this be done?

                  Do we need to switch IP too?

                   

                  Thanks,

                  • 6. Re: Switch to Standby DB
                    Suntrupth

                    Yes, Just change the tns-entry in the tnsnames.ora.

                     

                    Regards,
                    Suntrupth

                    • 7. Re: Switch to Standby DB
                      Renu-Oracle

                      Hi ,

                       

                      Kindly check below doc for dataguard switchover and faiolver.

                       

                      Switchover and Failover Operations

                       

                      Why you want to change the IP at primary and standby site after switchover / failover.

                      If you are thinking about client failover , you may go through below doc  :

                      How to configure Client Failover after Data Guard Switchover or Failover (https://mosemp.us.oracle.com/epmos/faces/ui/km/DocumentDisplay.jspx?id=316740.1Doc ID 316740.1)


                      Thanks,

                      Renu

                      • 8. Re: Switch to Standby DB

                        Thanks Sunny,

                         

                        Based on what you mentioned above:

                         

                        HA=

                        (description=

                        (address = (host = PROD)(protocol = tcp)(port = 1521))

                        (address = (host = STANDBY)(protocol = tcp)(port = 1521))

                        (failover = yes)

                        (connect_data = (service_name = orcl))

                         

                         

                        Just make sure only the listener at your present primary server is running.

                         

                         

                        How can we test fully the standby if we are still using the listener of the primary? We want to test fully independent standby. Is it possible that we use the listener of the standby?

                        I mean maybe a failover scenario but it can be switch back to the primary too? Is this possible?

                         

                        Thanks

                        • 9. Re: Switch to Standby DB
                          Suntrupth

                          The option of listener failover is for clients who were previously connected to the primary database, so that they can dynamically switch to the now new Primary server. For this you need to make the changes as I had described earlier.

                           

                           

                          Did you have a look at the documentation link I had posted?

                           

                           

                          "If the failover target is a physical or snapshot standby database, the original primary database must be reinstated or re-created in order to be a standby database for the new primary database. In addition, some standby databases may be disabled by the broker during the failover if the broker detects that they have applied redo beyond where the new primary database had applied. Any standby database that was disabled by the broker must be reinstated or re-created."

                           

                          Regards,

                          Suntrupth

                          • 10. Re: Switch to Standby DB
                            Tom321

                            Hi ,

                             

                            You will fully use your present primary, which is your former standby database after the switchover. You will NOT use the listener on your former primary database. You will be fully testing your standby host. You could also shutdown your old primary after the successfull failover for testing purpose (and close the resulting archivelog gap later).

                             

                            For testing your standby database you should use a controlled switchover, that way you can switch back to your former primary database after the test. If you use a failover you will have to reinstate your old primary using either a rebuild via rman (similar to the way you created your standby) or a flashback database if you have configured flashback logs.

                             

                            Regards

                            Thomas

                            • 11. Re: Switch to Standby DB

                              Thanks Tommy & Sunny

                               

                              For controlled switchover, does the archive log continues to be applied to the standby (former primary)? as if nothing is changed?

                              But I can not visualize how the IP can be kept as is. For example our primary server name is "primary-svr" with  ip 100.1000.100.1 and our standby is "standby-svr" with ip 100.100.100.2. And the app is pointing to "primary-svr". Do we need to change hostnames or ip? I can not really visualize how the our app see it as transparent.

                              • 12. Re: Switch to Standby DB
                                Suntrupth

                                The online redo log files will be continuously archived from the new primary database to all standby databases in the configuration. Just make sure you have standby redo logs configured on the primary prior to the switchover.

                                 

                                 

                                You will have to switch the host/ip address only in case of client connections currently connected. This can be easily achieved if you have set the tns-entries for both in the address list in tnsnames.ora.

                                 

                                 

                                Have a look at : http://docs.oracle.com/cd/E11882_01/server.112/e17023/sofo.htm#DGBKR3547

                                 

                                Regards,

                                Suntrupth