DB2 Version 10.1 for Linux, UNIX, and Windows

db2HADRStart API - Start high availability disaster recovery (HADR) operations

Starts HADR operations on a database.

Authorization

One of the following authorities:
  • SYSADM
  • SYSCTRL
  • SYSMAINT

Required connection

Instance. The API establishes a database connection if one does not exist, and closes the database connection when the API completes.

API include file

db2ApiDf.h

API and data structure syntax

SQL_API_RC SQL_API_FN
  db2HADRStart (
       db2Uint32 versionNumber,
       void * pParmStruct,
       struct sqlca * pSqlca);

typedef SQL_STRUCTURE db2HADRStartStruct
{
   char *piDbAlias;
   char *piUserName;
   char *piPassword;
   db2Uint32 iDbRole;
   db2Uint16 iByForce;
} db2HADRStartStruct;

SQL_API_RC SQL_API_FN
  db2gHADRStart (
       db2Uint32 versionNumber,
       void * pParmStruct,
       struct sqlca * pSqlca);

typedef SQL_STRUCTURE db2gHADRStartStruct
{
   char *piDbAlias;
   db2Uint32 iAliasLen;
   char *piUserName;
   db2Uint32 iUserNameLen;
   char *piPassword;
   db2Uint32 iPasswordLen;
   db2Uint32 iDbRole;
   db2Uint16 iByForce;
} db2gHADRStartStruct;

db2HADRStart 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 db2HADRStartStruct structure.
pSqlca
Output. A pointer to the sqlca structure.

db2HADRStartStruct data structure parameters

piDbAlias
Input. A pointer to the database alias.
piUserName
Input. A pointer to the user name under which the command will be executed.
piPassword
Input. A pointer to a string containing the password.
iDbRole
Input. Specifies which HADR database role should be started on the specified database. Valid values are:
DB2HADR_DB_ROLE_PRIMARY
Start HADR operations on the database in the primary role.
DB2HADR_DB_ROLE_STANDBY
Start HADR operations on the database in the standby role.
iByForce
Input. This argument is ignored if the iDbRole parameter is set to DB2HADR_DB_ROLE_STANDBY. Valid values are:
DB2HADR_NO_FORCE
Specifies that HADR is started on the primary database only if a standby database connects to it within a prescribed time limit.
DB2HADR_FORCE
Specifies that HADR is to be started by force, without waiting for the standby database to connect to the primary database.

db2gHADRStartStruct data structure specific parameters

iAliasLen
Input. Specifies the length in bytes of the database alias.
iUserNameLen
Input. Specifies the length in bytes of the user name.
iPasswordLen
Input. Specifies the length in bytes of the password.