BACKUP DB (Back up the database)

Use this command to back up an IBM Spectrum® Protect database to sequential access volumes.

Attention: To restore a database, the server must use information from the volume history file and the device configuration file. You must make and save copies of the volume history file and the device configuration file. These files cannot be recreated.

To determine how much extra storage space a backup requires, issue the QUERY DB command.

Restrictions: You cannot restore a server database if the release level of the server database backup is different from the release level of the server that is being restored. For example, an error occurs when you restore a Version 6.3 database and you are using a Version 7.1 server.
After the database backup is complete, the IBM Spectrum Protect server backs up information, depending on the options that are specified in the server options file. The following information is backed up:
  • Sequential volume-history information is backed up to all files that the VOLUMEHISTORY option specifies
  • Information about device configuration is backed up to all files that the DEVCONFIG option specifies
  • The server's master encryption key
If there is not enough space available on the defined active log directory volume or file space, you can define the Db2® option, overflowlogpath, to use a directory with the required space available. For example, use the following command to use the /home/tsminst2/overflow_dir directory:
db2 update db cfg for TSMDB1 using overflowlogpath /home/tsminst2/overflow_dir

Privilege class

To issue this command, you must have system privilege or unrestricted storage privilege.

Syntax

Read syntax diagramSkip visual syntax diagramBAckup DBDEVclass=device_class_name Type=FullType=IncrementalFullDBSnapshotVOLumenames=,volume_nameFILE:file_nameNUMStreams=1NUMStreams=numberScratch=YesScratch=YesNoWait=NoWait=NoYesDEDUPDEVice=NoDEDUPDEVice=NoYesENCRypt=YesENCRypt=YesNo1COMPress=NoCOMPress=NoYes2PROTECTKeys=YesPROTECTKeys=NoYesPASSword=password_name
Notes:
  • 1 This parameter applies only to database backup operations to cloud object storage.
  • 2 The default value of the COMPRESS parameter is conditional. If you specify the COMPRESS parameter in the BACKUP DB command, it overrides any COMPRESS parameter value that is set in the SET DBRECOVERY command. Otherwise, the value that is set in the SET DBRECOVERY command is the default.

Parameters

DEVclass (Required)
Specifies the name of the sequential access device class to use for the backup.

If the SET DBRECOVERY command is not issued to set a device class, the BACKUP DB command fails.

Restriction:
  • You cannot use a device class with a device type of NAS or CENTERA.
  • A restore database operation fails if the source for the restore is a FILE library. A FILE library is created if the FILE device class specifies SHARED=YES.

If all drives for this device class are busy when the backup runs, IBM Spectrum Protect cancels lower priority operations, such as reclamation, to make a drive available for the backup.

Type
Specifies the type of backup to run. This parameter is optional. The default is FULL. The following values are possible:
Full
Specifies that you want to run a full backup of the IBM Spectrum Protect database.
Incremental
Specifies that you want to run an incremental backup of the IBM Spectrum Protect database. An incremental (or cumulative) backup image contains a copy of all database data that is changed since the last successful full backup operation.
DBSnapshot
Specifies that you want to run a full snapshot database backup. The entire contents of a database are copied and a new snapshot database backup is created without interrupting the existing full and incremental backup series for the database.
VOLumenames
Specifies the volumes that are used to back up the database. This parameter is optional. However, if you specify SCRATCH=NO, you must specify a list of volumes.
Restriction: This parameter does not apply to a device class with a type of CLOUD.
volume_name
Specifies the volumes that are used to back up the database. Specify multiple volumes by separating the names with commas and no intervening spaces.
FILE:filename
Specifies the name of a file that contains a list of volumes that are used to back up the database. Each volume name must be on a separate line. Blank lines and comment lines, which begin with an asterisk, are ignored.
For example, to use volumes DB0001, DB0002, and DB0003, create a file that contains these lines:
DB0001
DB0002
DB0003
Name the file appropriately. For example:
  • Linux operating systemsAIX operating systemsTAPEVOL
  • Windows operating systemsTAPEVOL.DATA

You can then specify the volumes for the command as follows:

Linux operating systemsAIX operating systems
VOLUMENAMES=FILE:TAPEVOL
Windows operating systems
VOLUMENAMES=FILE:TAPEVOL.DATA
NUMStreams
Specifies the number of parallel data movement streams to use when you back up the database. The default value is 1. You can specify a value in the range 1 - 50. Increasing the value causes a corresponding increase in the number of database backup sessions to be used and the number of drives to be used for the device class. If you specify a NUMSTREAMS value in the BACKUP DB command, it overrides any value that is set in the SET DBRECOVERY command. Otherwise, the value that is set in the SET DBRECOVERY command is used. The NUMSTREAMS value is used for all types of database backups.
If a value is specified that is greater than the number of drives available for the device class, only the number of available drives are used. The available drives are those defined to the device class by the MOUNTLIMIT parameter or by the number of online drives for the specified device class. The session is displayed in the QUERY SESSION output.
If you increase the number of streams, more volumes are used from the corresponding device class for this operation. Using more volumes might improve the speed of the database backups, but at the cost of more volumes that are not fully used.
Scratch
Specifies whether scratch volumes can be used for the backup. This parameter is optional.
Restriction: This parameter does not apply to a device class with a type of CLOUD.
The default is YES. The following values are possible:
Yes
Specifies that scratch volumes can be used.

If you specify SCRATCH=YES and the VOLUMENAMES parameter, IBM Spectrum Protect uses only scratch volumes if space is unavailable on the specified volumes.

If you do not include a list of volumes by using the VOLUMENAMES parameter, you must either specify SCRATCH=YES or use the default.

No
Specifies that scratch volumes cannot be used.

If you specify volumes by using the VOLUMENAMES parameter and SCRATCH=NO, the backup fails if there is not enough space available to store the backup data on the specified volumes.

Wait
Specifies whether to wait for the server to complete processing this command in the foreground. The default is NO. The following values are possible:
No
Specifies that the server processes this command in the background. You can continue with other tasks while the command is being processed.

Messages that are created from the background process are displayed either in the activity log or the server console, depending on where messages are logged.

To cancel a background process, use the CANCEL PROCESS command. If a BACKUP DB background process is canceled, some of the database might have already been backed up before the cancellation.

Yes
Specifies that the server processes this command in the foreground. Wait for the command to complete before you continue with other tasks. The server then displays the output messages to the administrative client when the command completes.
Restriction: You cannot specify WAIT=YES from the server console.
DEDUPDEVice
Specifies that a target storage device supports data deduplication. When set to YES, the format for backup images is optimized for data deduplication devices, making backup operations more efficient. The following values are possible:
No
Specifies that a target storage device does not support data deduplication. NO is the default.
Ensure that this parameter is set to NO for the following
  • SCSI libraries
  • All devices that are defined with a FILE device class
  • Virtual tape libraries (VTL) that do not support the data deduplication function
Yes

Specifies that a target device supports data deduplication and that you want to optimize backups for this function. You can set this parameter to YES if you are using VTLs that support data deduplication.

ENCRypt
Specifies whether the database backup is encrypted. This parameter is optional and applies only to CLOUD device classes. The default value is YES. You can specify one of the following values:
Yes
Specifies that the database backup is encrypted by the server by using 256-bit Advanced Encryption Standard (AES) data encryption.
No
Specifies that the database backup is not encrypted by the server.
Restriction: Restrictions on database backup operations to cloud object storage prevent the encryption and compression options from being concurrently set to YES. Ensure that only encryption or compression is enabled.
  • To turn off encryption, specify ENCRYPT=NO.
  • To turn off compression, specify COMPRESS=NO.
COMPress
Specifies whether volumes that are created by the BACKUP DB command are compressed. The COMPRESS value is used for all types of database backups. This parameter is optional. The default value is conditional. If you specify the COMPRESS parameter on the BACKUP DB command, it overrides any value that is set in the SET DBRECOVERY command. Otherwise, the value that is set in the SET DBRECOVERY command is the default. You can specify one of the following values:
No
Specifies that the volumes that are created by the BACKUP DB command are not compressed.
Yes

Specifies that the volumes that are created by the BACKUP DB command are compressed.

Restrictions:
  • Use caution when you specify the COMPRESS parameter. Using compression during database backups can reduce the size of the backup files. However, compression can increase the time that is required to complete database backup processing.
  • Do not back up compressed data to tape. If your system environment stores database backups on tape, set the COMPRESS parameter to No in the SET DBRECOVERY and BACKUP DB commands.
  • For CLOUD device classes, ensure that only encryption or compression is enabled.
PROTECTKeys
Specifies that database backups include a copy of the server master encryption key that is used to encrypt node passwords, administrator passwords, and storage pool data. The master encryption key is stored in the dsmkeydb files. If you lose the dsmkeydb files, nodes and administrators are unable to authenticate with the server because the server is unable to read the passwords that are encrypted by using the master encryption key. In addition, any data that is stored in an encrypted storage pool cannot be retrieved without the master encryption key. This parameter is optional. The default is the value that is specified for the PROTECTKEYS parameter on the SET DBRECOVERY command. You can specify one of the following values:
No
Specifies that database backups do not include a copy of the server master encryption key.
Restriction: The PROTECTKEYS=NO parameter does not apply to a device class with a type of CLOUD.
Attention: If you specify PROTECTKEYS=NO, you must manually back up the master encryption key for the server and make the key available when you implement disaster recovery. You cannot recover from a disaster without the master encryption key.
Yes
Specifies that database backups include a copy of the master encryption key for the server.

If you specify PROTECTKEYS=YES, you must also specify the PASSWORD parameter.

Important: Cloud device classes require the PROTECTKEYS=YES parameter.
PASSword
Specifies the password that is used to protect the database backup. The default is the value that is specified for the PASSWORD parameter on the SET DBRECOVERY command. The minimum length of the password is 8 characters unless a different value is specified by using the SET MINPWLENGTH command. The maximum length of the password is 64 characters.
Important: Ensure that you remember this password. If you specify a password for database backups, you must specify the same password on the RESTORE DB command to restore the database.

Example: Run an incremental backup by using a scratch volume

Run an incremental backup of the database by using a scratch volume. Use a device class of FILE for the backup.
backup db devclass=file type=incremental

Example: Encrypt storage pool data in database backups

Encrypt storage pool data by specifying that database backups include a copy of the server master encryption key. Issue the following command:
backup db protectkeys=yes password=password_name

Example: Turn off encryption for database backup operations

To turn off encryption for database backup operations that use the CLOUD device class CLEVERDEV, issue the following command:
backup db devclass=cleverdev encrypt=no

Example: Turn off encryption and turn on compression for database backup operations to the cloud

To turn off encryption and turn on compression for database backup operations that use the CLOUD device class CLEVERDEV, issue the following command:
backup db devclass=cleverdev encrypt=no compress=yes

Related commands

Table 1. Commands related to BACKUP DB
Command Description
BACKUP DEVCONFIG Backs up IBM Spectrum Protect device information to a file.
BACKUP VOLHISTORY Records volume history information in external files.
CANCEL PROCESS Cancels a background server process.
DELETE VOLHISTORY Removes sequential volume history information from the volume history file.
EXPIRE INVENTORY Manually starts inventory expiration processing.
MOVE DRMEDIA Moves DRM media onsite and offsite.
PREPARE Creates a recovery plan file.
QUERY DB Displays allocation information about the database.
QUERY PROCESS Displays information about background processes.
QUERY VOLHISTORY Displays sequential volume history information that has been collected by the server.
SET DBRECOVERY Specifies the device class to be used for automatic backups.
SET DRMDBBACKUPEXPIREDAYS Specifies criteria for database backup series expiration.