In this blog post, I will talk about how you can perform workload routing across the standby databases based on Database role with GDS. GDS provides this functionality without requiring Oracle Clusterware to be installed. But if clusterware is installed then GDS automatically register the global service to GI home. When role transition happens in Data Guard Broker configuration, GDS relocates the global services automatically as per the role attribute. There is no need to write custom logic or database startup triggers to achieve this behavior.


In order to play with the GDS with active data guard, you must have the setup ready and functioning. Read more about GDS set up Here. And read here for  Data Guard environment with dg broker.

  My data guard and GDS environment set up is as below.

Add GDS Pool:

Now add the GDS pool.

Add TNS Entry for Primary/standby database at GSM Home:

We need to add below net services related with DG environment to GDS catalog server.

Add DG Broker configuration in GDS pool

Add the databases to GSM environment.

Add GDS service:

Now add the services to GDS for data guard environment. After adding services to the GDS pool, they will not be started until we start manually.After starting the services , we will check the configuration of each service in detail which explains services was created under which GSM, connection balance details, preferred instances and much more.

Client connection details for application


For maintenance work, sometimes we need to switch the database role to DR site. So I explained both switchover/failover.


To test the  failover with GDS, please test shutdown abort Primary database. Before/After shutdown, please check the connection from GSM and database. Fast start failover is enabled.

We can test the connectivity using “DGTST_HA” net service which should connect to the primary database, even though we connect from GSM server and even after db role change after failover.


We’ve seen the overview of the Global data services(services) in dataguard environment. Services can be added on standby database service for read only queries.

Leave a Reply