Creates a backup copy of a database or a table space.
Scope
This API only affects the node on which it is executed.
Authorization
One of the following:
Required Connection
Database. This API automatically establishes a connection to the specified database.
Version
sqlutil.h
C API Syntax
/* File: sqlutil.h */ /* API: Backup Database */ /* ... */ SQL_API_RC SQL_API_FN sqlubkp ( char * pDbAlias, unsigned long BufferSize, unsigned long BackupMode, unsigned long BackupType, unsigned long CallerAction, char * pApplicationId, char * pTimestamp, unsigned long NumBuffers, struct sqlu_tablespace_bkrst_list * pTablespaceList, struct sqlu_media_list * pMediaTargetList, char * pUserName, char * pPassword, void * pReserved2, unsigned long VendorOptionsSize, void * pVendorOptions, unsigned long Parallelism, unsigned long * pBackupSize, void * pReserved4, void * pReserved3, struct sqlca * pSqlca); /* ... */ |
Generic API Syntax
/* File: sqlutil.h */ /* API: Backup Database */ /* ... */ SQL_API_RC SQL_API_FN sqlgbkp ( unsigned short DbAliasLen, unsigned short UserNameLen, unsigned short PasswordLen, unsigned short * pReserved1, char * pDbAlias, unsigned long BufferSize, unsigned long BackupMode, unsigned long BackupType, unsigned long CallerAction, char * pApplicationId, char * pTimestamp, unsigned long NumBuffers, struct sqlu_tablespace_bkrst_list * pTablespaceList, struct sqlu_media_list * pMediaTargetList, char * pUserName, char * pPassword, void * pReserved2, unsigned long VendorOptionsSize, void * pVendorOptions, unsigned long Parallelism, unsigned long * pBackupSize, void * pReserved4, void * pReserved3, struct sqlca * pSqlca); /* ... */ |
API Parameters
Note: | An online backup operation may time out if there is an IX lock on sysibm.systables, because the DB2 backup utility requires an S lock on objects containing LOBs. |
For more information, see structure SQLU-MEDIA-LIST, and the Administration Guide.
REXX API Syntax
BACKUP DATABASE dbalias USING :value [USER username USING password] [TABLESPACE :tablespacenames] [ONLINE] [LOAD vendor-library [OPTIONS vendor-options] [OPEN num-sessions SESSIONS] | TO :target-area | USE ADSM [OPEN num-sessions SESSIONS] | USER_EXIT] [ACTION caller-action] [WITH num-buffers BUFFERS] [BUFFERSIZE buffer-size] [PARALLELISM parallelism-degree] |
REXX API Parameters
Sample Programs
Usage Notes
For information about database level backup, table space level backup, online and offline backup, backup file names, and supported devices, see the Command Reference.
For a general discussion of backup, see "Recovering a Database" in the Administration Guide.
See Also
sqluroll - Rollforward Database
sqlurestore - Restore Database.