API Reference
Deletes entries from the recovery history file.
Authorization
One of the following:
- sysadm
- sysctrl
- sysmaint
- dbadm
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.
API Include File
sqlutil.h
C API Syntax
/* File: sqlutil.h */
/* API: Prune Recovery History File */
/* ... */
SQL_API_RC SQL_API_FN
sqluhprn (
char * pTimestamp,
unsigned short ForceOption,
void * pReserved,
struct sqlca * pSqlca);
/* ... */
|
Generic API Syntax
/* File: sqlutil.h */
/* API: Prune Recovery History File */
/* ... */
SQL_API_RC SQL_API_FN
sqlghprn (
unsigned short TimestampLen,
char * pTimestamp,
unsigned short ForceOption,
void * pReserved,
struct sqlca * pSqlca);
/* ... */
|
API Parameters
- TimestampLen
- Input. A 2-byte unsigned integer representing the length in bytes
of the time stamp.
- pTimestamp
- Input. A string specifying the time stamp or part of a time stamp
(minimum yyyy, or year) 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.
- ForceOption
- Input. Indicates whether history file entries corresponding to the
most recent full backup and its restore set should be kept.
The restore set includes all table space backups and load copies taken after
the most recent full database backup. Valid values (defined in
sqlutil) are:
- SQLUH_NO_FORCE
- The most recent restore set entries will be kept, even if the time stamp
is less than or equal to the time stamp specified as input.
- SQLUH_FORCE
- 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.
- pReserved
- Reserved for future use.
- pSqlca
- Output. A pointer to the sqlca structure. For
more information about this structure, see SQLCA.
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.
Sample Programs
- C
- \sqllib\samples\c\rechist.c
- COBOL
- \sqllib\samples\cobol\rechist.cbl
- FORTRAN
- \sqllib\samples\fortran\rechist.f
- REXX
- \sqllib\samples\rexx\rechist.cmd
Usage Notes
Pruning the recovery 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 recovery 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
sqluhcls - Close Recovery History File Scan
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]