A snapshot backup operation uses the fast copying technology of a storage device to perform the data copying portion of the backup.
Before you can perform a snapshot backup, you must enable DB2 Advanced Copy Services (ACS). See: Enabling DB2 Advanced Copy Services (ACS).
Restrictions
You cannot recover individual table spaces by using snapshot backups.
If you use integrated snapshot backups, you cannot perform a redirected restore. A FlashCopy® restore reverts the complete set of volume groups containing all database paths to a prior point in time.
Issue the BACKUP DATABASE command with the USE SNAPSHOT parameter, as shown in the following example:
db2 backup db sample use snapshot
CALL SYSPROC.ADMIN_CMD
('backup db sample use snapshot')
int sampleBackupFunction( char dbAlias[],
char user[],
char pswd[],
char workingPath[] )
{
db2MediaListStruct mediaListStruct = { 0 };
mediaListStruct.locations = &workingPath;
mediaListStruct.numLocations = 1;
mediaListStruct.locationType = SQLU_SNAPSHOT_MEDIA;
db2BackupStruct backupStruct = { 0 };
backupStruct.piDBAlias = dbAlias;
backupStruct.piUsername = user;
backupStruct.piPassword = pswd;
backupStruct.piVendorOptions = NULL;
backupStruct.piMediaList = &mediaListStruct;
db2Backup(db2Version950, &backupStruct, &sqlca);
return 0;
}