Introduction

We've already seen the introduction, architecture of GDS in a previous article; this article explains how to install Global service managers and deploying GDS to the Data Guard and go through with the GDSCTL command line interface.

Installation of GSM

Installation of the GSM is similar like we install RDBMS product, the software dump first we need to extract from the zipped file and ensure able to run GUI by enabling xdisplay. Before installing the GSM lets clear where we are going to install the GSM and where the primary and standby databases are available.

GSM Location:                 ORA-X2 (India)
Primary database location:    ORA-X1 (Canada)
Standby(ADG):                 ORA-X2 (India)
GDS Catalog:                  ORA-X2 (india)

From the staging directory of GSM the runinstaller can be launched directly and no more settings/configurations required.

-bash-4.1$ ls -ltr
total 28
-rwxrwxr-x 1 oracle dba 500 Feb 7 2013 welcome.html
-rwxr-xr-x 1 oracle dba 8534 Jul 7 2014 runInstaller
drwxrwxr-x 4 oracle dba 4096 Jul 7 2014 install
drwxrwxr-x 2 oracle dba 4096 Jul 7 2014 response
drwxr-xr-x 14 oracle dba 4096 Jul 7 2014 stage
-bash-4.1$ pwd
/home/oracle/softwares/gsm
-bash-4.1$ 

start the runInstaller to install Global service manager on host ORA-X2. 

Figure 1 

 

 

Select the location of ORACLE_BASE and the GSM_HOME locations to perform installation of GSM

Figure 2

 

The prerequisite checks will be performed if any RPMs are missing or insufficient disk space and so on. 

Figure 3

 

After the confirmation , installer will be started. 

Figure 4

 

After the installation finished, need to execute the root.sh script of GSM_HOME from root user. 

Figure 5

[root@ORA-X2 Desktop]# /u01/app/oracle/product/gsm/12.1.0.2/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/gsm/12.1.0.2
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
[root@ORA-X2 Desktop]#

If the GSM servers are more than one, then repeat the above steps in each GSM server.

GDS Setup

In order to store the GDS metadata configurations and real time statistics and the load balancing information GDS needs the catalog database to store all kind of information, Hence create a database using DBCA or manually and finally configure oracle net service connection to the GDS database.

[oracle@ORA-X2 admin]$ . oraenv
ORACLE_SID = [india] ? GDSCAT
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ORA-X2 admin]$ sqlplus sys@gdscat as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 28 10:22:24 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show parameter db_name
NAME TYPE VALUE
———————————— ———– ——————————
db_name string GDSCAT
SQL>

We need to add the below net service of GDSCAT into all other pools (primary database, physical standby or OGG database) or any other available databases which are part of the configuration and also need to add pool databases service name into GDSCAT server, so that all the databases are reachable from/to GDSCAT database. Basically goal is to configure N to N connectivity between all the databases.

GCAT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.20)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = GCAT)
)
)

CANADA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = CANADA)
(UR = A)
)
)

INDIA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.20)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = INDIA)
(UR = A)
)
)

Preparing GDS accounts

From the 12c we are aware Oracle introduced many users such as to manage Data Guard broker we have user SYSDG and to manage backups we have user SYSBACKUP, like wise to manage Global data services we have dedicated users. These users will be the part of database during the creation. We have to configure the accounts from the primary database and also the GDS catalog databases as below.

Connect to the primary database and ensure the account “GSMUSER” is available and accessible.

SQL> show parameter db_unique_name

NAME TYPE VALUE
———————————— ———– ——————————
db_unique_name string CANADA
SQL> select username,account_status from dba_users where username='GSMUSER';

USERNAME ACCOUNT_STATUS
———— ————————–
GSMUSER EXPIRED & LOCKED
SQL> alter user gsmuser identified by gsmuser;

User altered.
SQL> alter user gsmuser account unlock;

User altered.
SQL> select username,account_status from dba_users where username='GSMUSER';

USERNAME ACCOUNT_STATUS
———— ————————–
GSMUSER OPEN

 

GDS catalog Database

We have configured gsmuser in primary database, but from the catalog database we have create additional global service manager user and also unlock the global service manager catalog user

SQL> show parameter db_name

NAME TYPE VALUE
———————————— ———– ——————————
db_name string GDSCAT
SQL> select username,account_status from dba_users where username='GSMCATUSER';

USERNAME ACCOUNT_STATUS
———— ————————–
GSMCATUSER EXPIRED & LOCKED
SQL> alter user gsmcatuser identified by gdscat;

User altered.
SQL> alter user gsmcatuser account unlock;

User altered.
SQL> create user gsmadm identified by gdscat;

User created.
SQL> grant gsmadmin_role to gsmadm;

Grant succeeded.
SQL> select username,account_status from dba_users where username in ('GSMCATUSER','GSMADM');

USERNAME ACCOUNT_STATUS
———— ————————–
GSMCATUSER OPEN
GSMADM OPEN
SQL> 

Test Connection to GDS Catalog.

GDSCTL>connect gsmadm/gdscat@192.168.0.20:1555/GCAT
Catalog connection is established
GDSCTL>

Configure GSM

So far we have performed ground work to install the GSM software and create necessary accounts from the pool database and the catalog database, now based on the accounts we will start configure the GSM.

-bash-4.1$ . oraenv
ORACLE_SID = [canada] ? gsm
The Oracle base remains unchanged with value /u01/app/oracle
-bash-4.1$ gdsctl
GDSCTL: Version 12.1.0.2.0 – Production on Sun Feb 28 18:36:37 IST 2016
Copyright (c) 2011, 2014, Oracle. All rights reserved.
Welcome to GDSCTL, type "help" for information.
Current GSM is set to GSMORA

GDSCTL>create catalog -database 192.168.0.20:1555/GCAT -user gsmadm/gdscat
Catalog is created
GDSCTL> 

Add GSM (INDIA)

The port of the GSM which we are adding should be different, so assign the new port. 

GDSCTL>add gsm -gsm gsmindia101 -listener 12102 -catalog ORA-X2:1555/GCAT

"gsmcatuser" password:
Create credential oracle.security.client.connect_string3
GSM successfully added
GDSCTL>

Obtain the configuration of added GSM

GDSCTL>set gsm -gsm gsmindia101
GDSCTL>config gsm -gsm gsmindia101
Name: gsmindia101
Endpoint 1: (ADDRESS=(HOST=ORA-X2.localdomain)(PORT=12102)(PROTOCOL=tcp))
Local ONS port: 6123
Remote ONS port: 6234
ORACLE_HOME path: /u01/app/oracle/product/gsm/12.1.0.2
GSM Host name: ORA-X2.localdomain
Region: regionora
Buddy
————————
GDSCTL>

Starting created GSM

GDSCTL>start gsm -gsm gsmindia101
GSM is started successfully
GDSCTL>

Create GDS Pool and Region 

GDSCTL>add gdspool -gdspool india
GDSCTL>add region -region APAC
GDSCTL>add gdspool -gdspool canada
GDSCTL>add region -region NA
GDSCTL>

Adding Primary Database to GDS Pool

GDSCTL>add database -connect 192.168.0.10:1521/canada -region NA -gdspool canada
"gsmuser" password:
DB Unique Name: CANADA
GDSCTL>

Adding Standby Database to GDS Pool

– Database should be in Open/Read-Only status.

GDSCTL>add database -connect 192.168.0.20:1521/india -region APAC -gdspool india
"gsmuser" password:
DB Unique Name: INDIA
GDSCTL>

 

Adding Global service to GDS Pool

GDSCTL>add service -service FINRW -preferred_all -gdspool canada
GDSCTL>start service -service FINRW -gdspool canada
GDSCTL>status service -service FINRW
Service "finrw.canada.oradbcloud" has 1 instance(s). Affinity: ANYWHERE
Instance "canada%1", name: "canada", db: "CANADA", region: "na", status: ready.
GDSCTL>

 

To check whether GSM is running or not

– This can be checked even using gdsctl utility and also from OS level.

[oracle@ORA-X2 trace]$ ps -ef|grep gsm
oracle 9047 7996 0 14:52 pts/1 00:00:00 /bin/sh /u01/app/oracle/product/gsm/12.1.0.2/bin/gdsctl
oracle 9050 9047 0 14:52 pts/1 00:00:07 /u01/app/oracle/product/gsm/12.1.0.2/jdk/jre//bin/java -DORACLE_HOME=/u01/app/oracle/product/gsm/12.1.0.2 -classpath /u01/app/oracle/product/gsm/12.1.0.2/jdbc/lib/ojdbc6.jar:/u01/app/oracle/product/gsm/12.1.0.2/network/jlib/gsm.jar:/u01/app/oracle/product/gsm/12.1.0.2/jlib/oraclepki.jar -Djava.util.logging.config.file=/u01/app/oracle/product/gsm/12.1.0.2/network/admin/logging.properties oracle.net.gsmctl.GSMCTLUtil
oracle 9118 1 0 14:58 ? 00:00:00 /u01/app/oracle/product/gsm/12.1.0.2/bin/gsmmon GSMINDIA101 -inherit
oracle 9120 1 0 14:58 ? 00:00:01 /u01/app/oracle/product/gsm/12.1.0.2/bin/gsmoci ifile=/u01/app/oracle/product/gsm/12.1.0.2/network/admin/gsm.ora GSMINDIA101 SNLSM:8ec90000 -inherit
oracle 9130 1 0 14:58 ? 00:00:02 /u01/app/oracle/product/gsm/12.1.0.2/bin/tnslsnr ifile=/u01/app/oracle/product/gsm/12.1.0.2/network/admin/gsm.ora GSMINDIA101 SNLSM:8ec90000 -inherit -mode gsm
oracle 9132 1 0 14:58 ? 00:00:04 /u01/app/oracle/product/gsm/12.1.0.2/bin/gsmping ifile=/u01/app/oracle/product/gsm/12.1.0.2/network/admin/gsm.ora GSMINDIA101 SNLSM:8ec90000 -inherit
oracle 9134 1 0 14:58 ? 00:00:01 /u01/app/oracle/product/gsm/12.1.0.2/bin/gsmopxy ifile=/u01/app/oracle/product/gsm/12.1.0.2/network/admin/gsm.ora GSMINDIA101 SNLSM:8ec90000 -inherit
oracle 9138 1 0 14:58 ? 00:00:01 /u01/app/oracle/product/gsm/12.1.0.2/bin/gsmonsc ifile=/u01/app/oracle/product/gsm/12.1.0.2/network/admin/gsm.ora GSMINDIA101 SNLSM:8ec90000 -inherit
oracle 9853 9334 0 15:32 pts/2 00:00:00 grep gsm
[oracle@ORA-X2 trace]$

Checking the GSM Listener

[oracle@ORA-X2 trace]$ ps -ef|grep tns
root 20 2 0 11:57 ? 00:00:00 [netns]
oracle 3701 1 0 12:01 ? 00:00:01 /u01/app/oracle/product/12.1.0.2/bin/tnslsnr LISTENER -inherit
oracle 7497 1 0 12:59 ? 00:00:05 /u01/app/oracle/product/12.1.0.2/bin/tnslsnr listener_gds -inherit
oracle 9130 1 0 14:58 ? 00:00:02 /u01/app/oracle/product/gsm/12.1.0.2/bin/tnslsnr ifile=/u01/app/oracle/product/gsm/12.1.0.2/network/admin/gsm.ora GSMINDIA101 SNLSM:8ec90000 -inherit -mode gsm
oracle 9886 9334 0 15:35 pts/2 00:00:00 grep tns
[oracle@ORA-X2 trace]$ . oraenv
ORACLE_SID = [india] ? gsm
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ORA-X2 trace]$ lsnrctl status GSMINDIA101
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 28-FEB-2016 15:35:11
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(HOST=ORA-X2.localdomain)(PORT=12102)(PROTOCOL=tcp))(CONNECT_DATA=(SERVICE_NAME=GDS$CATALOG.oradbcloud)))
STATUS of the LISTENER
————————
Alias GSMINDIA101
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 28-FEB-2016 14:58:19
Uptime 0 days 0 hr. 36 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/gsm/12.1.0.2/network/admin/gsm.ora
Listener Log File /u01/app/oracle/diag/gsm/ORA-X2/gsmindia101/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORA-X2.localdomain)(PORT=12102)))
Services Summary…
Service "GDS$CATALOG.oradbcloud" has 1 instance(s).
Instance "GCAT", status READY, has 2 handler(s) for this service…
Service "_MONITOR" has 1 instance(s).
Instance "GSMINDIA101", status READY, has 1 handler(s) for this service…
Service "_PINGER" has 1 instance(s).
Instance "GSMINDIA101", status READY, has 1 handler(s) for this service…
Service "finrw.canada.oradbcloud” has 1 instance(s).
Instance "canada%1", status READY, has 3 handler(s) for this service…
The command completed successfully
[oracle@ORA-X2 trace]$

Tracking created Service FINRW from primary

-bash-4.1$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 – Production on 28-FEB-2016 23:29:54
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.10)(PORT=1521)))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 – Production
Start Date 28-FEB-2016 20:02:22
Uptime 0 days 3 hr. 27 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0.2/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/ORA-X1/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.10)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary…
Service "CANADA" has 2 instance(s).
Instance "canada", status UNKNOWN, has 1 handler(s) for this service…
Instance "canada", status READY, has 1 handler(s) for this service…
Service "CANADA_DGB" has 1 instance(s).
Instance "canada", status READY, has 1 handler(s) for this service…
Service "canadaXDB" has 1 instance(s).
Instance "canada", status READY, has 1 handler(s) for this service…
Service "finrw.canada.oradbcloud” has 1 instance(s).
Instance "canada", status READY, has 1 handler(s) for this service…
The command completed successfully
-bash-4.1$

GDS Configuration

GDSCTL>config
Regions
————————
Name Buddy
—- —–
regionora
apac
na

GSMs
————————
gsmindia
gsmindia1
gsmindia101

GDS pools
————————
canada
dbpoolora
india

Databases
————————
canada
india

Services
————————
finrw

GDSCTL pending requests
————————
Command Object Status
——- —— ——

Global properties
————————
Name: oradbcloud
Master GSM: gsmindia101
GDSCTL>

Client connection using new service.

FINUSERS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = finrw.canada.oradbcloud) (UR=A)
)
)

-bash-4.1$ sqlplus sys@finusers as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sun Feb 28 23:35:35 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> 

Summary

We've seen how to install Global service manager and configuring the catalog database and adding global service managers to global data services catalog, Creating regions, pools, starting and stopping GSM, Monitoring the GSM processes and creating service and test case of client connection using the new service name in step by step manner.

About the Author

Nassyam Basha

Oracle DBA on 9i/10g/11g/12c with RAC 10g/11g on Linux/UNIX and Windows platforms including exposure on dBase, Foxpro, ORACLE 8i with forms & reports and always in front row to work on challenging tasks. I'm an Oracle 11g Certified Master and Oracle ACE Director.

Start the discussion at forums.toadworld.com