Skip to Main Content
  • Questions
  • Making a transparent application database switchover with Data Guard

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Geraldo.

Asked: May 20, 2020 - 4:03 am UTC

Last updated: May 26, 2020 - 1:26 am UTC

Version: 18.6

Viewed 1000+ times

You Asked

Hello, Ask TOM Team.

I have a 2-node RAC production database (18.6) with Data Guard configured (using data guard broker). My app's connection strings are pointing to scan-name\db-service.

What are the steps to make a database switchover without making any changes in application connection strings?

Thanks in advanced.

Regards,

and Connor said...

Your connection strings must know of both primary and standby clusters, and have the ability to switchover between the two, for example:

sales =
   (DESCRIPTION= 
     (FAILOVER=ON)
     (CONNECT_TIMEOUT=5)
     (ADDRESS_LIST=
       (ADDRESS=(HOST=boston-scan)(PORT=1521))
       (ADDRESS=(HOST=dallas-scan)(PORT=1521)))
     (CONNECT_DATA=(SERVICE_NAME=sales)))


You then define your services so that they operate on node(s) only when they are the primary

srvctl add service –db NORTH –service PAYROLL –role PRIMARY ....



There is a comple walk through of the switchover steps in the DataGuard documentation

https://docs.oracle.com/en/database/oracle/oracle-database/19/dgbkr/using-data-guard-broker-to-manage-switchovers-failovers.html#GUID-05918DD1-FB0F-435B-873B-A43BEC1C7638

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Review

A reader, May 22, 2020 - 1:09 am UTC

Thanks for the help.

I will check the documentation.

Regards,

Another point to take note

A reader, May 22, 2020 - 6:54 am UTC

What I have had experienced was that in spite of the settings applications using JDBC would go to the standby DB and error out as a result.

So, it is recommended that you have RETRY_COUNT set in the TNS entry so that it will attempt to connect to the PRIMARY in case of an error.

Cheers



Connor McDonald
May 26, 2020 - 1:26 am UTC

Thanks for the info

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database