Oracle GDS Configuration Overview (article 1)

Oracle Global Data Services allow organization to use replicas of databases effectively to manage workload by distributing users across all replicas. Many of these replicas are local or geographically separated and synchronized using Oracle Active DataGuard or Oracle Golden Gate. It is important load balance workload effectively across all replicas to achieve best performance. With Oracle Global Services, Companies can manage load and high availability using pool of replicated databases seamlessly in an optimal fashion with real-time information available in the Oracle database.

GDS extends the feature called Services. Services are widely used to manage workload in Real application cluster, Replicated databases  Active DataGuard or Golden Gate. GDS allows services to be deployed anywhere in the globally replicated environment. Clients can connect by simply specifying a service name, underlying distribution of databases are hidden to clients.

Global Service Manager

GDS configuration contains multiple Global Service Managers (GSM) per region. GSM is the central part of GDS configuration. GSM provide service level load balancing, failover and centralized management of services in the GDS configuration. GSM has listeners that client use to connect to global services. GSM monitors availability of database instances and global services and notifies clients if there is any failure. It also create a run time load balancing advisory and publishes it to clients connection pools

Global Data Service Catalog

Global Data Service Catalog stores the configuration data for GDS. One GDS configuration is associated with a unique catalog. It is stored in a database 12c or later. This is similar to rman catalog.

Oracle Notification Services

GDS uses Oracle Notification Services (ONS). It is used by GDS clients to receive load balancing advisory events from GSM.

Global Data Services Pool

A set of database can be grouped together to create a GDS pool. Partitioning GDS configuration databases to pools simplifies service management.

Global Data Services Region

GDS region is grouping of database in the GDS configuration based on geographical location. Network proximity between the databases in a same GDS region will be good as they are geographically closer. For example all GDS database in LA area can be grouped together for southern California customers.

GDS Installation and Initial configuration

Download GDS Software from Oracle website (here) and install by invoking .runInstaller. GSM home is almost similar to an ORACLE_HOME.

Once GSM is installed, we can start configuring the GDS. We will have to unloack GSMUSER from all the databases in the GDS configuration.

create Global Data Services administrators in the catalog DB (gsmcat). connect to the gsmcat database as sysdba

$ sqlplus / as sysdba
SQL> create user gsmadmin identified by ;
User created.
SQL> grant gsmadmin_role to gsmadmin;
Grant succeeded.
SQL> create user gsmau identified by ;
User created.
SQL> grant gsmadmin_role to gsmau;
Grant succeeded.
SQL> exit

Test connection to gsm catalog

GDS:snode1:oracle$ gdsctl
GDSCTL: Version 19.0.0.0.0 - Production on Thu Feb 27 14:46:57 PST 2020
Copyright (c) 2011, 2019, Oracle. All rights reserved.
Welcome to GDSCTL, type "help" for information.
Current GSM is set to GSMAU
GDSCTL> connect gsmadmin/oracle@DB19C
Catalog connection is established
GDSCTL>

Configuring GDS

Next step is to create GDS catalog on the catalog database. We will be using gdsctl to create catalog database. I already have 19c database created for catalog database.

create gds catalog

From the $ORACLE_HOME (gsm), invoke gdsctl

GDS:snode1:oracle$ gdsctl
GDSCTL: Version 19.0.0.0.0 - Production on Thu Feb 27 14:46:57 PST 2020
Copyright (c) 2011, 2019, Oracle. All rights reserved.
Welcome to GDSCTL, type "help" for information.
Current GSM is set to GSMAU
GDSCTL>create catalog -database DB19C -user gsmadmin/oracle
Catalog is created
GDSCTL>

Creating GSM to the GDS catalog

GDSCTL>  add gsm -gsm gsmau -listener 12102 -catalog DB19C
GDSCTL>
GDSCTL> config gsm -gsm gsmau
Name: gsmau
Endpoint 1: (ADDRESS=(HOST=snode1.localdomain)(PORT=12012)(PROTOCOL=tcp))
Local ONS port: 6123
Remote ONS port: 6234
ORACLE_HOME path: /u03/app/oracle/product/GDS19300
GSM Host name: snode1.localdomain
Region: regionora
You can see a default region “REGIONORA” is added automatically.
A default pool also created by default
GDSCTL> config gdspool
Name Broker Sharded
---- ------ -------
dbpoolora No No

Start the gsm

GDSCTL>start gsm -gsm gsmau
GSM is started successfully

These are some of the daemon/process running out of GSM Home

gsmmon GSMAU -inherit
gsmoci ifile=/u03/app/oracle/product/GDS19300
tnslsnr ifile=/u03/app/oracle/product/GDS1930
gsmping ifile=/u03/app/oracle/product/GDS1930
gsmopxy ifile=/u03/app/oracle/product/GDS1930
gsmonsc ifile=/u03/app/oracle/product/GDS1930

Adding a Database to a Global Data Services Pool

Next step is to add databases to Global Data Services. In order to add Global Data Services to GDS, ‘gsmuser’ has to be unlocked at database level.

ALTER USER gsmuser ACCOUNT UNLOCK;
ALTER USER gsmuser IDENTIFIED BY gsmuser;
add database -connect primcluster-scan.just.net:1521:ORCL -pwd db$gsmuser -region regionora -gdspool dbpoolora
GDSCTL: Version 19.0.0.0.0 - Production on Thu Mar 05 15:14:00 PST 2020
Copyright (c) 2011, 2019, Oracle. All rights reserved.
Welcome to GDSCTL, type "help" for information.
Current GSM is set to GSMAU
GDSCTL> connect gsmadmin/oracle@DB19C
Catalog connection is established
GDSCTL> add database -connect primcluster-scan.just.net:1521/ORCL -pwd gsmuser
DB Unique Name: orcl
The operation completed successfully
GDSCTL> add database -connect stdby-scan.just.net:1521/STDBY -pwd gsmuser
DB Unique Name: stdby
The operation completed successfully
GDSCTL> config database
Name Pool Status State Region Availability
---- ---- ------ ----- ------ ------------
orcl dbpoolora Ok none regionora -
stdby dbpoolora Ok none regionora -
GDSCTL>

Adding Services to Global Data Services Pool

GDSCTL> add service -service orcl_service -preferred_all
The operation completed successfully
GDSCTL> start service -service orcl_service
GSM-45052: Service management error
ORA-45553: Service orcl_service does not have any instances defined for database\(s\) orcl,stdby,.
ORA-06512: at "GSMADMIN_INTERNAL.DBMS_GSM_POOLADMIN", line 16242
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "GSMADMIN_INTERNAL.DBMS_GSM_POOLADMIN", line 16170
ORA-06512: at line 1
 
The operation completed successfully
GDSCTL> config service
 
 
Name           Network name                  Pool           Started Preferred all 
----           ------------                  ----           ------- ------------- 
orcl_service   orcl_service.dbpoolora.oradbc dbpoolora      No      Yes           
               loud                                                              
 
GDSCTL>

Looks like the orcl_service  is not associated with any instance of orcl or stdby

ORCL1:roll:oracle$ srvctl config database -d ORCL
Database unique name: ORCL
Database name: ORCL
Oracle home: /u01/app/oracle/product/18c
Oracle user: oracle
Spfile: +DATA1/ORCL/PARAMETERFILE/spfile.272.1020622483
Password file: +DATA1/ORCL/PASSWORD/pwdorcl.256.1020614571
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: 
Disk Groups: DATA1,FRA
Mount point paths: 
Services: orcl_service,srv_rman =è orcl_service is associated with ORCL
Type: RAC
Start concurrency: 
Stop concurrency: 
OSDBA group: dba
OSOPER group: dba
Database instances: ORCL1,ORCL2
Configured nodes: roll,stone
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services: 
Database is administrator managed. – Admin Managed
 
STDBY1:ol7node1:oracle$ srvctl config database -d STDBY
Database unique name: STDBY
Database name: STDBY
Oracle home: /u02/app/oracle/product/18c
Oracle user: oracle
Spfile: +DATA1/STDBY/spfileSTDBY.ora
Password file: +DATA1/STDBY/pwstdby
Domain:
Start options: open
Stop options: immediate
Database role: PHYSICAL_STANDBY
Management policy: AUTOMATIC
Server pools: 
Disk Groups: DATA1,FRA
Mount point paths: 
Services: orcl_service    è  orcl_service   is associated with STDBY.
Type: RAC
Start concurrency: 
Stop concurrency: 
OSDBA group: dba
OSOPER group: dba
Database instances: STDBY1,STDBY2
Configured nodes: ol7node1,ol7node2
CSS critical: no
CPU count: 0
Memory target: 0
Maximum memory: 0
Default network number for database services: 
Database is administrator managed. – Admin managed
 
GDSCTL> databases
Database: "orcl" Registered: N State: Ok ONS: Y. Role: N/A Instances: 0 Region: regionora
   Service: "orcl_service" Globally started: N Started: N
            Scan: Y Enabled: Y Preferred: Y
Database: "stdby" Registered: N State: Warnings ONS: Y. Role: N/A Instances: 0 Region: regionora
   Service: "orcl_service" Globally started: N Started: N
            Scan: Y Enabled: Y Preferred: Y
 
 
GDSCTL> modify service -service orcl_service -database orcl -modify_instances -preferred ORCL1,ORCL2
The operation completed successfully
GDSCTL> modify service -service orcl_service -database STDBY -modify_instances -preferred STDBY1,STDBY2
The operation completed successfully
GDSCTL> start service -service orcl_service
GSM Warnings: 
GSM-40134: Service is already running on all possible databases
GDSCTL> config service
 
 
Name           Network name                  Pool           Started Preferred all 
----           ------------                  ----           ------- ------------- 
orcl_service   orcl_service.dbpoolora.oradbc dbpoolora      Yes     Yes           
               loud                    

Note:

I got following errors when I was trying to modify my service. 
 
     GDSCTL> modify service -service orcl_service -database STDBY -modify_instances -preferred STDBY1,STDBY2
GSM Errors: 
stdby:ORA-01033: ORACLE initialization or shutdown in progress (ngsmoci_connect)         
 
GDSCTL> add service -service orcl_service -preferred_all
GSM Warnings: 
stdby:ORA-01033: ORACLE initialization or shutdown in progress (ngsmoci_connect)        

Above issues was resolved when I re-copied password file from primary to standby  and made sure both are exactly same.

More GDS articles coming…