Frequently Asked Questions - DB2 iDataAgent
- Do we need to restart the DB2 services on Windows after a fresh SnapProtect installation or an upgrade?
- Do we need to restart DB2 instances on UNIX after upgrading a SnapProtect DB2 agent?
- Do we need to reboot the DB2 client on Windows after installing the latest updates on it?
- Can we modify the archive, retrieve and audit error paths after the installation?
- Are there additional steps to take when the DB2 Agent is installed on an existing client?
- Do I need to configure any database parameters to manage the DB2 Archive Logs?
- Can we use USEREXIT method instead of LOGARCHMETH1 Vendor method to manage DB2 log files?
- Can we automatically update DB2 parameters?
- How can we interactively update DB2 parameters?
- When do I have to take a full offline backup for successful data protection operations using SnapProtect?
- Can I perform DB2 database backups as a user with no operating system password?
- Can we protect data on non-global zones if the File System iDataAgent is installed only on the global zone?
- How do we protect DB2 data on a non-global zone?
- How are data only backup jobs retained?
- How is a log backup scheduled?
- Is it possible to backup the logs directly to the media?
- How can we prevent log backup failures due to different database and alias names?
- How are command line backup images displayed in the CommCell Console?
- Can I submit a backup job when the DB2 instance is down?
- Can we perform out-of-place restores of databases created in another directory?
- Can we perform out-of-place restores of databases with non-default parameter values?
- How do I prevent a command line restore from taking place during an online backup?
- Can we restore a job that had started automatically and on waiting mode for available resource if that resource is used by data restore?
- Can I restore an SnapProtect backup image on a disk using CommCell Console?
- Do I need to delete the online logs when performing a point-in-time restore?
- Command Line
- How do I view the list of available backup Images from command line?
- How are the jobs displayed when you restore from incremental or delta backups using multiple streams from the command line?
- How do you archive and manage the Logs in SnapProtect?
- Can I enable DB2 triggered pruning for SnapProtect DB2 iDataAgent?
- Can I restore a load copy image directly on a database?
- What does the return code 23 in db2diag.log indicate?
- What files are placed in the DB2 Audit Error Path and are they pruned?
- How do I determine the DB2 Instance Port Number?
Do we need to restart the DB2 services on Windows after a fresh SnapProtect installation or an upgrade?
Yes. You must restart the DB2 services on Windows after a fresh SnapProtect installation or an upgrade.
Select the Restart Oracle/DB2 Services (if applicable) check box in Install Software Options or Upgrade Software Options dialog box for Windows clients.
Yes, DB2 Services need to be restarted to clear the API information cached by the db2logmgr process.
This will prevent the following error from occurring during an online full backup job.
SQL2428N The BACKUP did not complete because one or more of the requested log files could not be retrieved
Yes. You must reboot the Windows DB2 client computer after installing the latest DB2 updates. Select Reboot Machine option in Update Installer dialog box. SnapProtect installer verifies and if required restarts the computer.
Yes, you can modify the archive, retrieve, and audit error paths after the DB2 Data Agent installation. You can use additional settings in the CommCell Console to specify the new directory paths.. For more information, see Modifying the Archive Path, Modifying the Audit Error Path and Modifying the Retrieve Path.
These additional settings can also be set in the etc/CommVaultRegistry/Galaxy/Instance001/Db2Agent/.properties file. Add an entry for each directory path that you want to modify.
Note: Set the permissions for the archive, audit error and retrieve paths with the following permissions
|No UNIX groups used in the SnapProtect installation||Read, write and execute permissions (777) for everybody|
|UNIX groups used in the SnapProtect installation||Read, write and execute permissions (775) for the UNIX group
Note: The DB2 instance users must be part of the UNIX group
Before you create the new path, move all logs files in the old log directory to the new log directory.
A log at the following location:
is moved to
If you install the agent on on an existing client, you must run the cvpkgchg command to update the group permission after you install the agent. You can use this command to set the group and permission to the correct level which prevents the backup job from failing. For information on how to change the group permissions, see Changing UNIX Groups and Permissions on UNIX Clients.
Yes. You need to configure the LOGARCHMETH1 and LOGARCHOPT1 parameters to manage DB2 Archive Logs using SnapProtect VENDOR Library interface.
db2 update db cfg for sample using LOGARCHMETH1 "VENDOR:/opt/SnapProtect/Base64/libDb2Sbt.so"
db2 update db cfg for sample using LOGARCHOPT1 "'CvClientName=<db2client>,CvInstanceName=Instance001'"
The USEREXIT method is deprecated beginning in DB2 version 9.5. You can use this method in DB2 versions prior to v9.5 (instead of the LOGARCHMETH1 method) to backup the DB2 log files.
From the DB2 Console, type the following command to set the USEREXIT parameter:
db2 update database configuration for <database name> using USEREXIT on
Yes. You can automatically update DB2 parameters (LOGARCHMETH1, LOGARCHOPT1, VENDOROPT, TRACKMOD) using the Db2_config.sh script to perform backups and restores. For information, see Automatically Updating DB2 Parameters.
From the DB2 console, type the following command to update the LOGARCHMETH1 parameter:
snapprotect_install_path is the location in which SnapProtect is installed.
db2 update db cfg for <database name> using LOGARCHMETH1 "'VENDOR:/snapprotect_install_path/Base/libDb2Sbt.so'"
db2 update db cfg for test_db using LOGARCHMETH1 " '/db_installs/Base/libDb2Sbt.so' "
The AIX, Solaris and Z Linux 64bit DB2 installation use Base64 and for 32bit DB2 installation, use Base as the installation location.
The remaining platforms use Base as the location for both 32bit and 64bit DB2 installations.
db2 update db cfg for <database name> using LOGARCHMETH1 "'VENDOR:/snapprotect_install_path/Base/libDb2Sbt.so'"
db2 update database configuration for testdb using LOGARCHMETH1 " '/db_installs/Base/libDb2Sbt.so' "
db2 update db cfg for <database name> using LOGARCHMETH1 "'VENDOR:SnapProtect_install_path\Base\Db2Sbt.dll'"
db2 update database configuration for testdb1 using LOGARCHMETH1 "VENDOR:D:\CV\SnapProtect\Base\DB2Sbt.dll"
All 32bit/64bit windows should use Base folder.
DB2 Configuration on cluster
Type the following command to configure the VENDOROPT parameter:
db2 update db cfg for <database name> using VENDOROPT "'CvClientName=<Your_DB2_Client_Name>,CvInstanceName=<Your_SnapProtect_Instance_Name>'"
Type the following command to configure the LOGARCHOPT1 parameter:
db2 update db cfg for <database name> using LOGARCHOPT1 "'CvClientName=<Your_DB2_Client_Name>,CvInstanceName=<Your_SnapProtect_Instance_Name>'"
From the DB2 Console, type the following commands in the below mentioned sequence to enable the TRACKMOD database configuration parameter and perform incremental or delta DB2 backups.
db2 update db cfg for <database name> using TRACKMOD on
When do I have to take a full offline backup for successful data protection operations using SnapProtect?
When a database is in a roll forward recovery mode for the first time (when the LOGARCHMETH1 parameter value is set to either LOGRETAIN, USEREXIT, DISK, TSM, or VENDOR), perform a traditional full offline backup for the database. In case of a HADR setup, perform the traditional full offline backup on the primary database.
Yes, you can perform your DB2 database backups as UNIX operating system user with no password.
Can we protect data on non-global zones if the File System iDataAgent is installed only on the global zone?
Yes. We can protect file system data on non-global zones if the File System iDataAgent is installed only on the global zone. However, in order to enable consistent backups of application specific data on the non-global zones, you will need to install the corresponding application specific iDataAgent on the non-global zone.
In order to enable consistent backups of DB2 data on a non-global zone, you need to install the DB2 iDataAgent on the non-global zone.
If a data backup job does not have a linked log backup, it will be retained based on the retention days only and does not follow the retention cycles. However, if the data backup job is linked to a log backup job, the retention will be based on both the number of days as well as the retention cycles.
A new subclient (Logs only) needs to be created for each DB2 database and schedule backup for every nn hours. The frequency depends upon the transactional activity on the database.
SnapProtect copies the archive logs to ARCHIVE Path to efficiently utilize the Media resources. The Logs are then backed up to media.
It is possible to backup the logs directly to the media without copying to archive log path. You need to set sDb2ThresholdALFN registry key to 1.
To prevent archive log backup failures, ensure that the name that you select is the actual name of the database and not the alias name for the database. If the database name and the corresponding alias name are different, both names are displayed under Available DB Names; if both names are the same, the name that is displayed is the database name. To find the database names and their aliases, run the following command as a DB2 instance owner on the DB2 client:
C:\Program Files\IBM\SQLLIB\BIN>db2 list db directory
System Database Directory
Number of entries in the directory = 2
Database alias = TESTDBS1
Database name = TDBS1
Local database directory = C:
When you run DB2 command line offline/online backup jobs, the backup image is always displayed as online in the CommCell Console.
Yes, the job remains in the pending state until you manually start the instance.
If you defined your own directory for the database instead of using the DB2 default location when you created the database, you cannot restore this database to either a new database or another instance in the conventional manner.
If the DBHEAP, UTIL_HEAP, and/or APP_CTL_HEAP_SZ configuration parameters for the (source) database that you want to restore contain a value other than the default value, you cannot restore this database to either a new database or another instance in the conventional manner.
In DB2 9.7 and later, by default, a full online DB2 database backup includes the transaction log files to ensure that there is a consistent backup image. DB2 includes all the required logs in the backup image when the transaction spreads across many log files, even when a log file backup exists. If the backed up log files are deleted, DB2 will submit a log restore request to the DB2 Agent.
There are three parameters that you use to control the log files actions:
Note: If you set both the max_log parameter and num_log_span parameter to 0, DB2 uses unlimited log space.
- The LOGPRIMARY parameter sets the storage amount that the software allocates for log files. Make sure that all uncommitted transactions are logged in the LOGPRIMARY number of log files. This prevents the DB2 application from sending a log file retrieval request for the archived files.
- The max_log parameter limits the percentage of log space that one transaction can use. Set this to 0 to have no limit of one transaction. To limit the space, set the value to the percentage that you want the limit to be.
- The num_log_span parameter limits the number of log files that one transaction spans.. Set this to 0 to have no limit of one transaction. To limit the number of files, set this parameter to the number of files.
Can we restore a job that had started automatically and on waiting mode for available resource if that resource is used by data restore?
when you try to restore a database after updating the archive logs with new changes in a database, the new restore job automatically starts and hangs displaying the status as waiting with the following error:
The media is already reserved by some other jobs.
Since the main restore job is not yet completed, the current restore job will wait for the main restore job to complete.
You can restore the current job by configuring the bDisableRestoreCaching registry key's dword value as 1 on CommServe under the Resource Manager.
No. Currently, you cannot restore an SnapProtect backup image on a disk using CommCell Console. You can only restore a regular backup image to a location on a disk.
Yes, before performing a point-in-time restore, you must delete the online logs or the restore will fail.
Use the QS_QueryDB2Backup.sp query. Options are available to query against:
- database backups,
- log backups or
- database or log backups within a time range
The time zone listed in the output is the client time zone.
The query for database backups is as follows:
qoperation execscript -sn QS_querydb2backup -si '<Clientname>' -si '<DB2InstanceName>' -si '<DB2DatabaseName>' -si '<DATA|LOGS>'
QScript[QS_querydb2backup] CS[CSName] DB[CommServ] SP[QS_querydb2backup]
|InstanceName||The DB2 (and not the SnapProtect) instance name|
|DatatbaseName||The DB2 (and not the SnapProtect) database name|
|ClientName||The SnapProtect client|
|DATA||Query the data|
|LOGS||Query the logs|
./qoperation execscript -sn QS_querydb2backup -si 'test-db2' -si 'db2inst1' -si 'NEW' -si 'DATA'
1 rows affected)
JOB ID BACKUP TYPE NODE NUMBER TIMESTAMP STREAMS
------ ----------- ----------- -------------- -------
324706 Full . NODE0000 20140605173337 1
324708 Full . NODE0000 20140605175230 1
324714 Full . NODE0000 20140605185154 1
324715 Full . NODE0000 20140605185439 1
324716 Full . NODE0000 20140605185905 3
324719 Incr . NODE0000 20140605190413 3
324720 Delta . NODE0000 20140605190805 3
324727 Full . NODE0000 20140605213125 1
324728 Full . NODE0000 20140605213343 1
324729 Full . NODE0000 20140605213608 3
324731 Incr . NODE0000 20140605214035 3
324732 Delta . NODE0000 20140605214419 3
324741 Full . NODE0000 20140605230636 1
324742 Full . NODE0000 20140605230937 1
324743 Full . NODE0000 20140605231157 3
324745 Incr . NODE0000 20140605231553 3
324746 Delta . NODE0000 20140605231919 3
Qscript Execution Succeeded!
./qoperation execscript -sn QS_querydb2backup -si 'test-db2' -si 'db2inst1' -si 'NEW' -si 'LOGS'
1 rows affected) JOB ID NODE NUMBER CHAIN NUMBER FIRST LOG NUMBER LAST LOG NUMBER FIRST LOG TIME LAST LOG TIME
------ ----------- ------------ ---------------- --------------- -------------------- -------------------
326173 NODE0000 C0000040 1327 . 1366 . 2014-06-11 12:27:52 2014-06-11 12:29:38
326170 NODE0000 C0000040 1287 . 1326 . 2014-06-11 12:25:11 2014-06-11 12:27:28
326165 NODE0000 C0000040 1247 . 1286 . 2014-06-11 12:22:18 2014-06-11 12:24:42
326160 NODE0000 C0000040 1207 . 1246 . 2014-06-11 12:19:41 2014-06-11 12:21:51
326159 NODE0000 C0000040 1167 . 1206 . 2014-06-11 12:16:59 2014-06-11 12:19:12
326153 NODE0000 C0000040 1127 . 1166 . 2014-06-11 12:14:37 2014-06-11 12:16:34
326149 NODE0000 C0000040 1087 . 1126 . 2014-06-11 12:11:59 2014-06-11 12:14:10
326147 NODE0000 C0000040 1047 . 1086 . 2014-06-11 12:09:41 2014-06-11 12:11:32
326122 NODE0000 C0000038 1007 . 1045 . 2014-06-05 23:05:16 2014-06-05 23:19:58
326122 NODE0000 C0000040 1046 . 1046 . 2014-06-11 11:49:44 2014-06-11 11:49:44
324742 NODE0000 C0000038 1007 . 1020 . 2014-06-05 23:05:16 2014-06-05 23:10:46
324740 NODE0000 C0000036 967 . 1004 . 2014-06-05 21:30:09 2014-06-05 21:44:53
324740 NODE0000 C0000038 1005 . 1006 . 2014-06-05 23:04:21 2014-06-05 23:04:46
324728 NODE0000 C0000036 967 . 979 . 2014-06-05 21:30:09 2014-06-05 21:34:57
324726 NODE0000 C0000036 964 . 966 . 2014-06-05 21:29:22 2014-06-05 21:29:36
324726 NODE0000 C0000034 927 . 963 . 2014-06-05 18:50:32 2014-06-05 19:08:48
324715 NODE0000 C0000034 927 . 938 . 2014-06-05 18:50:32 2014-06-05 18:57:53
324712 NODE0000 C0000034 887 . 926 . 2014-05-27 12:31:41 2014-06-05 18:49:54
Qscript Execution Succeeded!
How are the jobs displayed when you restore from incremental or delta backups using multiple streams from the command line?
Depending on the backup images, the multi stream restore jobs will be displayed as given below:
- If restoring from a full backup, all the streams in the restore job will use the same job ID.
- If restoring from an incremental backup image, and if the number of streams is 1 or 2, the restore job will display 3 different job ids. This is because, when restoring from incremental backup image, the restore job will abort midway to restore the previous full backup and then return back to restore the incremental backup image; if the number of streams is 3 or more, the restore job will complete with 2 job IDs. In this case, the restore job will abort midway to restore the previous full backups and when resumed combines with the first job to display the same job ID.
- Similarly, when restoring from a delta backup image, the restore job will abort midway to restore the previous full and incremental backups and then come back to restore the delta backup image. Restores from delta backups will complete with multiple job IDs.
- When an online log is full, DB2 requests SnapProtect VENDOR Library API to archive the logs.
- By default, SnapProtect archives the logs in ARCHIVE_PATH specified during SnapProtect installation.
- The logs will be moved to media when Logs backup is scheduled from CommCell console or when the number of Logs in Archive Path exceed the configured threshold.
- ARCHIVE PATH can be configured using sDB2_ARCHIVE_PATH registry key.
Yes. You can enable DB2 triggered pruning for SnapProtect's DB2 iDataAgent using sCvDB2EnablePruning registry key.
No. The DB2 server will not allow you to restore a load copy image directly on a database.
Return code 23 specifies the end of file or media. This return code can be ignored. SnapProtect sends this return code to DB2 once it completes the transfer of the entire data for the requested log or data backup.
The DB2 Audit Error path which is created during the DB2 Agent installation. Temporary files are written to the DB2 Audit Error path during log backups. To help improve the efficiency during a log restore, SnapProtect looks for these files first to use for the restore. If they are not present, SnapProtect could restore these files in this directory for efficient log restores. The file names have the format M_<archiveFileId>_<CommCellId> .
The "cvd" process prunes files in this directory which have not be accessed in 4 to 5 days which prevents the DB2 Audit Error path size from growing.
Perform the following to find out the DB2 Instance port number that you need to perform a table level restore to a different host, instance, or database.
On the command line, type the following command:
cat /etc/services | grep '<db2_instance_name>'
Search the WINNT/SYSTEM32/DRIVERS/ETC/Services file.