IBM Support

Syntax for db2gcf used in start, stop and monitor DB2 scripts

Troubleshooting


Problem

DB2 automation scripts are used by TSAMP to start, stop and monitor DB2 resources. How do these scripts actually interact with DB2 components ?

Symptom

May 01 13:21:49 node01 user:debug /usr/sbin/rsct/sapolicies/db2/hadrV97_stop.ksh[7667760]: su - db2inst1 -c db2gcf -t 3600 -d -i db2inst1 -i db2inst1 -h MYDB -L ...
May 15 13:30:11 node01 user:debug /usr/sbin/rsct/sapolicies/db2/hadrV97_start.ksh[8519854]: su - db2inst1 -c db2gcf -t 3600 -u -i db2inst1 -i db2inst1 -h MYDB -L ...
May 15 13:31:25 carme user:debug /usr/sbin/rsct/sapolicies/db2/hadrV97_monitor.ksh[8650900]: su - db2inst1 -c /home/db2inst1/sqllib/bin/db2gcf -t 14 -s -i db2inst1 -i db2inst1 -h MYDB returns 1

Resolving The Problem

The DB2 Generic Control Facility (GCF) is the primary interface used by the DB2 automation scripts to start, stop, and monitor DB2 components. The DB2 automation scripts use the db2gcf command with a variety of command line flags are args to do the equivalent of tasks such as db2start, db2stop, db activate, takeover, etc.

Just typing "db2gcf" on the command line yields the following syntax information:



Specify proper command options

db2gcf -[udkcs] [-i <instance> ] [-h <dbName> ] [-p <p1,p2,p3,p4...pn>] [-t <timeout>] [-L]

where :
-u Start service
-d Stop service
-k Kill service
-s Return status of service
-o Display information about GCF module
-c Clean up left over resources
Only one service option can be specified at a time

-i <instance> : specify instance name or if this option is not included
then DB2INSTANCE if set is used.

-h <dbName> : specify database name to start, monitor, or stop
Note: this option can only be used by the integrated solution with
Tivoli System Automation for Multiplatforms (SA MP).

-p <p1,p2,p3...pn> : commands apply to a list of partitions
Specify the partition numbers without any space and separated by comma

-t <timeout> : Timeout value in seconds.
This timeout is used instead of gcf default for the specified service.

-L : Specify -L to enable error logging. Instance specific
logging will go to log file db2diag.log in instance log directory.
Non instance specific logging will go to system log files.

db2gcf Return Values :
0 : db2 service(start,stop,kill) success or db2gcf -s status Available
1 : db2 service(start,stop) failed or db2gcf -s status Not Available
2 : db2gcf has been called with wrong number of parameters
3 : gcfmodule failed to execute the requested service

[{"Product":{"code":"SSRM2X","label":"Tivoli System Automation for Multiplatforms"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"3.2.2;3.2.1;3.2;3.1","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
24 June 2019

UID

swg21637707