Stops the local or remote DB2® instance.
This API can be issued against a single member, list of members or, globally against all members. In a DB2 pureScale® environment, this API may be issued against a specific host to stop the instance services on that machine.
None
db2ApiDf.h
SQL_API_RC SQL_API_FN
db2InstanceStop (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2InstanceStopStruct
{
db2int8 iIsRemote;
char *piRemoteInstName;
db2DasCommData * piCommData;
db2StopOptionsStruct * piStopOpts;
} db2InstanceStopStruct;
typedef SQL_STRUCTURE db2DasCommData
{
db2int8 iCommParam;
char *piNodeOrHostName;
char *piUserId;
char *piUserPw;
} db2DasCommData;
typedef SQL_STRUCTURE db2StopOptionsStruct
{
db2Uint32 iIsProfile;
char *piProfile;
db2Uint32 iIsNodeNum;
db2NodeType iNodeNum;
db2Uint32 iIsHostName;
char *piHostName;
db2Uint32 iStopOption;
db2Uint32 iCallerac;
db2Sint32 iQuiesceDeferMinutes;
} db2StopOptionsStruct;
SQL_API_RC SQL_API_FN
db2gInstanceStop (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2gInstanceStopStruct
{
db2int8 iIsRemote;
db2Uint32 iRemoteInstLen;
char *piRemoteInstName;
db2gDasCommData * piCommData;
db2StopOptionsStruct * piStopOpts;
} db2gInstanceStopStruct;
typedef SQL_STRUCTURE db2gDasCommData
{
db2int8 iCommParam;
db2Uint32 iNodeOrHostNameLen;
char *piNodeOrHostName;
db2Uint32 iUserIdLen;
char *piUserId;
db2Uint32 iUserPwLen;
char *piUserPw;
} db2gDasCommData;
The following is an example of shutting down an instance.
struct sqlca sqlca; // sqlca to carry the sqlcode
struct db2InstanceStopStruct instanceStopStruct;
struct db2StopOptionsStruct stopOptions;
instanceStopStruct.iIsRemote = FALSE; // demo local instance
instanceStopStruct.piRemoteInstName = NULL;
instanceStopStruct.piStopOpts = &stopOptions;
In a DB2 pureScale environment, you can set individual options depending on what type of operation you want to run against the instance. For example:
stopOptions.iOption = SQLE_HOST;
stopOptions.iIsHostName = TRUE;
strcpy(stopOptions.piHostName, "ca1");
stopOptions.iOption = SQLE_HOST | SQLE_FORCE;
stopOptions.iIsHostName = TRUE;
strcpy(stopOptions.piHostName, "ca1");
stopOptions.iIsNodeNum = TRUE;
stopOptions.iNodeNum = 10;
stopOptions.iOption = SQLE_FORCE;
stopOptions.iIsNodeNum = TRUE;
stopOptions.iNodeNum = 10;
stopOptions.iIsNodeNum = TRUE;
stopOptions.iNodeNum = 40;
stopOptions.iOption = SQLE_FORCE;
stopOptions.iIsNodeNum = TRUE;
stopOptions.iNodeNum = 40;
instanceStopStruct.piStopOpts = NULL;
stopOptions.iOption = SQLE_FORCE;
Finally, you need to invoke the db2InstanceStop API to shut down the instance.
db2InstanceStop(db2Version1010, &instanceStopStruct, &sqlca);