Starts 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 start the instance services on that machine.
None
db2ApiDf.h
SQL_API_RC SQL_API_FN
db2InstanceStart (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2InstanceStartStruct
{
db2int8 iIsRemote;
char *piRemoteInstName;
db2DasCommData * piCommData;
db2StartOptionsStruct * piStartOpts;
} db2InstanceStartStruct;
typedef SQL_STRUCTURE db2DasCommData
{
db2int8 iCommParam;
char *piNodeOrHostName;
char *piUserId;
char *piUserPw;
} db2DasCommData;
typedef SQL_STRUCTURE db2StartOptionsStruct
{
db2Uint32 iIsProfile;
char *piProfile;
db2Uint32 iIsNodeNum;
db2NodeType iNodeNum;
db2Uint32 iOption;
db2Uint32 iIsHostName;
char *piHostName;
db2Uint32 iIsPort;
db2PortType iPort;
db2Uint32 iIsNetName;
char *piNetName;
db2Uint32 iTblspaceType;
db2NodeType iTblspaceNode;
db2Uint32 iIsComputer;
char *piComputer;
char *piUserName;
char *piPassword;
db2QuiesceStartStruct iQuiesceOpts;
} db2StartOptionsStruct;
typedef SQL_STRUCTURE db2QuiesceStartStruct
{
db2int8 iIsQRequested;
db2int8 iQOptions;
char *piQUsrName;
char *piQGrpName;
db2int8 iIsQUsrGrpDef;
} db2QuiesceStartStruct;
SQL_API_RC SQL_API_FN
db2gInstanceStart (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2gInstanceStStruct
{
db2int8 iIsRemote;
db2Uint32 iRemoteInstLen;
char *piRemoteInstName;
db2gDasCommData * piCommData;
db2gStartOptionsStruct * piStartOpts;
} db2gInstanceStStruct;
typedef SQL_STRUCTURE db2gDasCommData
{
db2int8 iCommParam;
db2Uint32 iNodeOrHostNameLen;
char *piNodeOrHostName;
db2Uint32 iUserIdLen;
char *piUserId;
db2Uint32 iUserPwLen;
char *piUserPw;
} db2gDasCommData;
typedef SQL_STRUCTURE db2gStartOptionsStruct
{
db2Uint32 iIsProfile;
char *piProfile;
db2Uint32 iIsNodeNum;
db2NodeType iNodeNum;
db2Uint32 iOption;
db2Uint32 iIsHostName;
char *piHostName;
db2Uint32 iIsPort;
db2PortType iPort;
db2Uint32 iIsNetName;
char *piNetName;
db2Uint32 iTblspaceType;
db2NodeType iTblspaceNode;
db2Uint32 iIsComputer;
char *piComputer;
char *piUserName;
char *piPassword;
db2gQuiesceStartStruct iQuiesceOpts;
} db2gStartOptionsStruct;
typedef SQL_STRUCTURE db2gQuiesceStartStruct
{
db2int8 iIsQRequested;
db2int8 iQOptions;
db2Uint32 iQUsrNameLen;
char *piQUsrName;
db2Uint32 iQGrpNameLen;
char *piQGrpName;
db2int8 iIsQUsrGrpDef;
} db2gQuiesceStartStruct;
The following is an example of starting up an instance:
struct sqlca sqlca; // sqlca to carry the sqlcode
struct db2InstanceStartStruct instanceStartStruct;
struct db2StartOptionsStruct startOptions;
instanceStartStruct.iIsRemote = FALSE; // demo local instance
instanceStartStruct.piRemoteInstName = NULL;
instanceStartStruct.piStartOpts = &startOptions;
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:
startOptions.iOption = SQLE_HOST;
startOptions.iIsHostName = TRUE;
strcpy(startOptions.piHostName, "ca1");
startOptions.iIsNodeNum = TRUE;
startOptions.iNodeNum = 10;
startOptions.iIsNodeNum = TRUE;
startOptions.iNodeNum = 40;
instanceStartStruct.piStartOpts = NULL;
Finally, you need to invoke the db2InstanceStart API to start the instance.
db2InstanceStart(db2Version1010, &instanceStartStruct, &sqlca);