Closes and truncates the active log file for a recoverable
database. If user exit is enabled, it also issues an archive request.
Authorization
One of the following authorities:
- SYSADM
- SYSCTRL
- SYSMAINT
- DBADM
Required connection
This API automatically
establishes a connection to the specified database. If a connection
to the specified database already exists, the API will return an error.
API include file
db2ApiDf.h
API and data structure syntax
SQL_API_RC SQL_API_FN
db2ArchiveLog (
db2Uint32 versionNumber,
void * pDB2ArchiveLogStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2ArchiveLogStruct
{
char *piDatabaseAlias;
char *piUserName;
char *piPassword;
db2Uint16 iAllNodeFlag;
db2Uint16 iNumNodes;
SQL_PDB_NODE_TYPE *piNodeList;
db2Uint32 iOptions;
} db2ArchiveLogStruct;
SQL_API_RC SQL_API_FN
db2gArchiveLog (
db2Uint32 versionNumber,
void * pDB2ArchiveLogStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2gArchiveLogStruct
{
db2Uint32 iAliasLen;
db2Uint32 iUserNameLen;
db2Uint32 iPasswordLen;
char *piDatabaseAlias;
char *piUserName;
char *piPassword;
db2Uint16 iAllNodeFlag;
db2Uint16 iNumNodes;
SQL_PDB_NODE_TYPE *piNodeList;
db2Uint32 iOptions;
} db2gArchiveLogStruct;
db2ArchiveLog API parameters
- versionNumber
- Input. Specifies the version and release level of the variable
passed in as the second parameter, pDB2ArchiveLogStruct.
- pDB2ArchiveLogStruct
- Input. A pointer to the db2ArchiveLogStruct structure.
- pSqlca
- Output. A pointer to the sqlca structure.
db2ArchiveLogStruct data structure parameters
- piDatabaseAlias
- Input. A string containing the database alias (as cataloged in
the system database directory) of the database for which the active
log is to be archived.
- piUserName
- Input. A string containing the user name to be used when attempting
a connection.
- piPassword
- Input. A string containing the password to be used when attempting
a connection.
- iAllNodeFlag
- Applicable to partitioned database environment only. Input. Flag
indicating whether the operation should apply to all nodes listed
in the db2nodes.cfg file. Valid values are:
- DB2ARCHIVELOG_NODE_LIST
- Apply to nodes in a node list that is passed in piNodeList.
- DB2ARCHIVELOG_ALL_NODES
- Apply to all nodes. piNodeList should be
NULL. This is the default value.
- DB2ARCHIVELOG_ALL_EXCEPT
- Apply to all nodes except those in the node list passed in piNodeList.
- iNumNodes
- Partitioned database environment only. Input. Specifies the number
of nodes in the piNodeList array.
- piNodeList
- Partitioned database environment only. Input. A pointer to an
array of node numbers against which to apply the archive log operation.
- iOptions
- Input. Reserved for future use.
db2gArchiveLogStruct data structure specific parameters
- iAliasLen
- Input. A 4-byte unsigned integer representing the length in bytes
of the database alias.
- iUserNameLen
- Input. A 4-byte unsigned integer representing the length in bytes
of the user name. Set to zero if no user name is used.
- iPasswordLen
- Input. A 4-byte unsigned integer representing the length in bytes
of the password. Set to zero if no password is used.