DB2 Version 9.7 for Linux, UNIX, and Windows

db2InstanceStop API - Stop instance

Stops the local or remote DB2® instance.

Scope

In a single-partition database environment, the scope is that single database partition only. In a partitioned database environment, it is the collection of all logical database partition servers defined in the node configuration file, db2nodes.cfg.

Authorization

One of the following:
  • sysadm
  • sysctrl
  • sysmaint

Required connection

None

API include file

db2ApiDf.h

API and data structure syntax

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 iStopOption;
             db2Uint32 iCallerac;
} 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;

db2InstanceStop API parameters

versionNumber
Input. Specifies the version and release level of the structure passed as the second parameter pParmStruct.
pParmStruct
Input. A pointer to the db2InstanceStopStruct structure.
pSqlca
Output. A pointer to the sqlca structure.

db2InstanceStopStruct data structure parameters

iIsRemote
Input. An indicator set to TRUE or FALSE. This parameter should be set to TRUE if this is a remote start.
piRemoteInstName
Input. The name of the remote instance.
piCommData
Input. A pointer to the db2DasCommData structure.
piStopOpts
Input. A pointer to the db2StopOptionsStruct structure.

db2DasCommData data structure parameters

iCommParam
Input. An indicator set to TRUE or FALSE. This parameter should be set to TRUE if this is a remote start.
piNodeOrHostName
Input. The database partition or hostname.
piUserId
Input. The user name.
piUserPw
Input. The user password.

db2StopOptionsStruct data structure parameters

iIsProfile
Input. Indicates whether a profile is specified. Possible values are TRUE and FALSE. If this field indicates that a profile is not specified, the file db2profile is used.
piProfile
Input. The name of the profile file that was executed at startup to define the DB2 environment for those nodes that were started (MPP only). If a profile for the db2InstanceStart API was specified, the same profile must be specified here.
iIsNodeNum
Input. Indicates whether a node number is specified. Possible values are TRUE and FALSE. If specified, the stop command only affects the specified node.
iNodeNum
Input. The database partition number.
iStopOption
Input. Option. Valid values are:
SQLE_NONE
Issue the normal db2stop operation.
SQLE_FORCE
Issue the FORCE APPLICATION (ALL) command.
SQLE_DROP
Drop the node from the db2nodes.cfg file.
iCallerac
Input. This field is valid only for the SQLE_DROP value of the OPTION field. Valid values are:
SQLE_DROP
Initial call. This is the default value.
SQLE_CONTINUE
Subsequent call. Continue processing after a prompt.
SQLE_TERMINATE
Subsequent call. Terminate processing after a prompt.

db2gInstanceStopStruct data structure specific parameters

iRemoteInstLen
Input. Specifies the length in bytes of piRemoteInstName.

db2gDasCommData data structure specific parameters

iNodeOrHostNameLen
Input. Specifies the length in bytes of piNodeOrHostName.
iUserIdLen
Input. Specifies the length in bytes of piUserId.
iUserPwLen
Input. Specifies the length in bytes of piUserPw.