IBM Books

Administrative API Reference

db2Prune - Prune Recovery History File

Deletes entries from the recovery history file.

Authorization

One of the following:

Required Connection

Database. To delete entries from the recovery history file for any database other than the default database, a connection to the database must be established before calling this API.

Version

db2ApiDf.h

C API Syntax



/* File: db2ApiDf.h */
/* API: Prune Recovery History File */
/* ... */
SQL_API_RC SQL_API_FN
  db2Prune (
    db2Uint32 version,
    void * pDB2PruneStruct,
    struct sqlca * pSqlca);
 
typedef struct
{
  char * piString,
  db2Uint32 iEID,
  db2Uint32 iCallerAction,
  db2Uint32 iOptions
} db2PruneStruct;
/* ... */
 

Generic API Syntax



/* File: db2ApiDf.h */
/* API: Prune Recovery History File */
/* ... */
SQL_API_RC SQL_API_FN
  db2GenPrune (
    db2Uint32 version,
    void * pDB2GenPruneStruct,
    struct sqlca * pSqlca);
 
typedef struct
{
  db2Uint32 iStringLen;
  char * piString,
  db2Uint32 iEID,
  db2Uint32 iCallerAction,
  db2Uint32 iOptions
} db2GenPruneStruct;
/* ... */
 

API Parameters

version
Input. Specifies the version and release level of the structure passed in as the second parameter, pDB2PruneStruct.

pDB2PruneStruct
Input. A pointer to the db2PruneStruct structure.

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.

iStringLen
Input. Specifies the length in bytes of piString.

piString
Input. A pointer to a string specifying a time stamp or a log sequence number (LSN). The time stamp or part of a time stamp (minimum yyyy, or year) is used to select records for deletion. All entries equal to or less than the time stamp will be deleted. A valid time stamp must be provided; there is no default behavior for a NULL parameter.

This parameter can also be used to pass an LSN, so that logs can be pruned on a mobile workstation.

iEID
Input. Specifies a unique identifier that can be used to prune a single entry from the history file.

iCallerAction
Input. Specifies the type of action to be taken. Valid values (defined in db2ApiDf) are:

DB2PRUNE_ACTION_HISTORY
Remove history file entries.

DB2PRUNE_ACTION_LOG
Remove log files from the active log path.

iOptions
Input. Valid values (defined in db2ApiDf) are:

DB2PRUNE_OPTION_FORCE
Force the removal of the last backup.

DB2PRUNE_OPTION_LSNSTRING
Specify that the value of piString is an LSN, used when a caller action of DB2PRUNE_ACTION_LOG is specified.

REXX API Syntax



PRUNE RECOVERY HISTORY BEFORE :timestamp [WITH FORCE OPTION]

REXX API Parameters

timestamp
A host variable containing a time stamp. All entries with time stamps equal to or less than the time stamp provided are deleted from the recovery history file.

WITH FORCE OPTION
If specified, the recovery history file will be pruned according to the time stamp specified, even if some entries from the most recent restore set are deleted from the file. If not specified, the most recent restore set will be kept, even if the time stamp is less than or equal to the time stamp specified as input.

Usage Notes

Pruning the history file does not delete the actual backup or load files. The user must manually delete these files to free up the space they consume on storage media.

Attention: If the latest full database backup is deleted from the media (in addition to being pruned from the history file), the user must ensure that all table spaces, including the catalog table space and the user table spaces, are backed up. Failure to do so may result in a database that cannot be recovered, or the loss of some portion of the user data in the database.

See Also

db2HistoryCloseScan - Close Recovery History File Scan

db2HistoryGetEntry - Get Next Recovery History File Entry

db2HistoryOpenScan - Open Recovery History File Scan

db2HistoryUpdate - Update Recovery History File.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]