Topics | How To | Related Topics
Third Party Command Line Backups
Plan your backup jobs for this agent by reviewing the following information:
This agent supports the following backup types:
This agent has the following unique functionality.
For the DB2 iDataAgent, Delta backup works as described in Incremental Backups. See Incremental Backups for information on DB2 Delta backups.
Some database iDataAgents run backups using a system-generated script that is run behind the scenes from a command line. The CommCell Console serves as a front-end user interface for specifying various backup arguments and parameters that are passed to the backup script that is run. Depending on your agent, you can specify, for example, the application-specific Backup Level, whether the backups will be online or offline, as well as buffer and bundle sizes, among other settings. Although the backup arguments/parameters vary among iDataAgents, they all function in a similar manner. These arguments are set at the subclient level from the respective iDataAgent's Subclient Properties dialog box tab.
For step-by-step instructions, see Configure Backup Arguments.
Each DB2 database has its own configuration. To back up DB2 data successfully, you must enable the appropriate database configuration parameter(s). You must set these parameters based on the state of the database, backup type, and/or data type as follows:
Before you change any configuration parameter, ensure that no applications are currently using the affected database. Also, be sure to consult your database administrator regarding business requirements for the database. |
db2 update db cfg for <databas e name> using LOGARCHOPT1"'CvClientName=<CvClientName>,CvInstanceName=<CvInstanceName>'"
Example:
db2 update db cfg for test_db using LOGARCHOPT1"'CvClientName=testhost,CvInstanceName=Instance001'"
db2 update db cfg for <database name> using VENDOROPT"'CvClientName=<CvClientName>,CvInstanceName=<CvInstanceName>'"
Example:db2 update db cfg for test_db using VENDOROPT"'CvClientName=testhost,CvInstanceName=Instance001'"
db2 update database configuration for <database name> using LOGRETAIN on
On a Cluster setup, you need to update the LOGARCHOPT1 and VENDOROPT database configuration parameters on a virtual machine name instead of physical client name. |
Updating VENDOROPT and LOGARCHOPT1 is optional, if the DB2 instance is running on non cluster configuration and default simpana instance (Instance001).
CvClientName and CvInstanceName parameters are case sensitive.
CvClientName must match with the client name configured in cs.
db2 update database configuration for <database name> using LOGRETAIN on
From the DB2 Console, type the following command to set the TRACKMOD parameter:
db2 update database configuration for <database name> using TRACKMOD on
You need to set the TRACKMOD database configuration parameter ON and run a full offline database backup to perform a successful delta/incremental backup. |
db2 update database configuration for <database name> using USEREXIT on
To back up DB2 log files for DB2 version 8.2 or later using the SBT interface, enter the following commands to set the required parameters:
db2 update database configuration for <database name> using USEREXIT OFF
db2 update database configuration for <database name> using LOGARCHMETH1 VENDOR:<install path><shared library file>
where:
<install path> identifies the base install directory
<shared library file> identifies the name of the shared library file libDB2Sbt.* (where * identifies the file extension, which will vary per the operating system)
for example:
db2 update database configuration for <database name> using Logretain recovery
db2 update database configuration for <database name> using LOGARCHMETH1
“VENDOR:/opt/Calypso/Base/libDb2Sbt.so”
Whenever you change the TRACKMOD database configuration parameter, be sure to run a full offline database backup. Otherwise, the TRACKMOD parameter will not be updated.
With the SBT interface, log files are staged to an archive path, and an On Demand backup of the log files is performed when a certain threshold is reached. Alternatively, the user can submit a backup request for any number of log files from the CommCell Console.
The USEREXIT/SBT interface program takes the logs from the DB2 directory and transfers them first to the threshold directory that was defined during the DB2 iDataAgent install and then to tape. If you subsequently use the Delete option, the logs are deleted from the threshold directory; otherwise, the logs are kept in this directory. By default, the threshold directory can hold 1000 logs. If the threshold directory attempts to hold more than 1000 logs, a command line backup for the logs starts automatically, and the logs are transferred to tape.
You can control the threshold value by adding the sDb2ThresholdALFN <number> registry key to the Db2Agent registry, where <number> indicates the number of logs you want to hold in the threshold directory before the logs will automatically start backing up to tape. Otherwise, by default, the threshold directory can hold 1000 logs.
Before performing any backup procedures for this agent, review the following information:
If you have created subclients for databases, and if you have included the log files in these subclients, you can create a complete backup of the database by backing up these subclients. If you have created a group of online subset subclients for the database, you must back up all of these subclients to create a complete backup. If you have created separate subclients for log files, and if they are not included with the subclients defined for databases or subsets, then the subclients for log files must also be backed up to create a complete backup.
Multiple streams are supported for data protection and recovery operations with this agent; however, before utilizing multiple streams, you should understand how their use affects operations. For more information, see Streams.
When Oracle and DB2 iDataAgents are installed on the same client, make sure that both Oracle and DB2 users are part of the primary user groups.
You can perform backups of one or more DB2 databases from the command line interface.
Command line backups enable you to perform backup operation on multiple clients simultaneously. In order to run the backups from command line, you need an input xml file which contains the parameters for configuring the backup options. This input xml file can be obtained from one of the following ways:
To run command line operations you must first login to the CommServe as follows:
qlogin -cs <commserve name> -u <user name>
qlogin -cs server1 -u user1
Execute the saved .xml script using the following qoperation execute command:
qoperation execute -af qoperation_db2_backup.xml -backupLevel <FULL| INCREMENTAL| DIFFERENTIAL> -subclientName <SubclientName> -clientName <DB2CleintName> -instanceName <DB2InstanceName> -backupsetName <DB2BackupSetName>
Example Using XML File:
qoperation execute -af qoperation_db2_backup.xml -backupLevel FULL -subclientName default -clientName dbserveaix2 -instanceName db2inst5 -backupsetName TESTDB
Example without using XML File:
qoperation backup -c client -a < iDataAgentType> -i <DB2InstanceName> -b <DB2BackupSetName> -s <SubclientName> -t <Q_FULL|Q_INC|Q_DIFF>
./qoperation backup -c dbserveaix2 -a Q_UNIX_DB2 -i db2inst5 -b TESTDB -s default -t Q_FULL
Verify the status of the job using the following command:
qlist job –j JOBID
Once the job completes, logout from the CommServe using the qlogout command.
qlogout [-cs commserver] [-all] [-tf tokenfile] [-tk token] [-h]
Use the following steps to backup the DB2 database:
At the Command Prompt, type the appropriate online/offline backup command for the specific platform.
Examples:db2 backup db <database name> load '<software install path>/Base/libDb2Sbt.so'
db2 backup db <database name> load '<software install path>/Base64/libDb2Sbt.so'
db2 backup db <database name> load '<software install path>\Base\Db2Sbt.dll'
db2 backup db <database name> online load '<software install path>\Base\Db2Sbt.dll'
db2 backup database <db_name> online load '<software install path>/Base/libDb2Sbt.so' include logs
db2 backup db <database name> incremental load '<software install path>/Base/libDb2Sbt.so'
db2 backup db <database name> incremental delta load '<software install path>/Base/libDb2Sbt.so'
DB2 third party command line backups running on multiple streams will generate separate job ids for each stream.
From the DB2 command prompt, type the following backup command.Example:
db2 backup database <database_name> online load '<software_install_path>/Base/libDb2Sbt.so' open 3 sessions
db2 backup database <database_name> online load '<software_install_path>\Base\Db2Sbt.dll' open 10 sessions
where <database_name> is the name of the DB2 database and <software_install_path> is the install path for the agent software (e.g., level1/install).