DB2 Version 9.7 for Linux, UNIX, and Windows

db2UpdateAlternateServerForDB API - Update the alternate server for a database alias in the system database directory

Updates the alternate server for a database alias in the system database directory.

Scope

This API affects the system database directory.

Authorization

One of the following:
  • sysadm
  • sysctrl

Required connection

None

API include file

db2ApiDf.h

API and data structure syntax

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

typedef SQL_STRUCTURE db2UpdateAltServerStruct
{
   char *piDbAlias;
   char *piHostName;
   char *piPort;
} db2UpdateAltServerStruct;

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

typedef SQL_STRUCTURE db2gUpdateAltServerStruct
{
   db2Uint32 iDbAlias_len;
   char *piDbAlias;
   db2Uint32 iHostName_len;
   char *piHostName;
   db2Uint32 iPort_len;
   char *piPort;
} db2gUpdateAltServerStruct;

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

db2UpdateAltServerStruct data structure parameters

piDbAlias
Input. A string containing an alias for the database.
piHostName
Input. A string containing the host name or the IP address of the node where the alternate server for the database resides. The host name is the name of the node that is known to the TCP/IP network. The maximum length of the host name is 255 characters. The IP address can be an IPv4 or an IPv6 address.
piPort
Input. The port number of the alternate server database manager instance. The maximum length of the port number is 14 characters.

db2gUpdateAltServerStruct data structure specific parameters

iDbAlias_len
Input. The length in bytes of piDbAlias.
iHostName_len
Input. The length in bytes of piHostName.
iPort_len
Input. The length in bytes of piPort.

Usage notes

The API will only be applied to the system database directory.

The API should only be used on a server. If it is issued on a client, it will be ignored and warning SQL1889W will be issued.

If LDAP (Lightweight Directory Access Protocol) support is enabled on the current machine, the alternate server for the database will automatically be updated in the LDAP directory.