Frequently Asked Questions - DB2 iDataAgent

Table of Contents

Installation

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.

Do we need to restart DB2 instances on UNIX after upgrading a SnapProtect DB2 agent?

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

Do we need to reboot the DB2 client after installing the latest updates on it?

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.

Can we modify the archive, retrieve and audit error paths after the installation?

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.

sDB2_ARCHIVE_PATH <new_archive_path>
sDB2_AUDIT_ERROR_PATH <new_audit_error_path>
sDB2_RETRIEVE_PATH <new_retrieve_path>

Example

sDB2_ARCHIVE_PATH /database/db2/GDB2ARCHIVE
sDB2_AUDIT_ERROR_PATH /database/db2/GDB2ERROR
sDB2_RETRIEVE_PATH /database/db2/GDB2RETRIEVE

Note: Set the permissions for the archive, audit error and retrieve paths with the following permissions

Configuration 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:

/db2inst3/DBNOAUTO/NODE0000/C0000007/S0000011.LOG

is moved to

/db2inst3/DBNOAUTO/NODE0000/C0000036/S0000011.LOG

Configuration

Do I need to configure any database parameters to manage the DB2 Transaction Logs?

Yes. You need to configure the LOGARCHMETH1 and LOGARCHOPT1 parameters to manage DB2 transaction 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'"

Can we use the USEREXIT method instead of LOGARCHMETH1 Vendor method to manage the DB2 log files?

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

Can we automatically update DB2 parameters?

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.

How can we interactively update 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'"

Example:

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.

Unix:

db2 update db cfg for <database name> using LOGARCHMETH1 "'VENDOR:/snapprotect_install_path/Base/libDb2Sbt.so'"

Example:

db2 update database configuration for testdb using LOGARCHMETH1 " '/db_installs/Base/libDb2Sbt.so' "

Windows:

db2 update db cfg for <database name> using LOGARCHMETH1 "'VENDOR:SnapProtect_install_path\Base\Db2Sbt.dll'"

Example:

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>'"

For Delta or Incremental Backups

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

Backup

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.

Can I perform DB2 database backups as a user with no operating system password?

Yes. Update-46055(db2PasswordLessUser) provided with service pack 4a, allows you to successfully perform your DB2 database backups as a password less Operating System user. However, this Update is applicable only for Unix based DB2 backups.

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.

How do we protect DB2 data on a 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.

How are data only backup jobs retained?

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.

How is a log backup scheduled?

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.

Is it possible to backup the logs directly to the media?

SnapProtect copies the transaction 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 transaction log path. You need to set sDb2ThresholdALFN Additional Setting to 1.

How can we prevent log backup failures due to different database and alias names?

To prevent transaction 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:

How are Command Line backup images displayed in the CommCell Console?

When you run DB2 command line offline/online backup jobs, the backup image is always displayed as online in the CommCell Console.

Can I submit a backup job when the DB2 instance is down?

Yes, the job remains in the pending state until you manually start the instance.

Restore

Can we perform out-of-place restores of databases created in another directory?

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.

Can we perform out-of-place restores of databases with non-default parameter values?

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.

Why is a Command line Restore job submitted during an online full backup?

In DB2 V9.5 and higher,  by default, a full online DB2 database backup includes the transaction logs to ensure a consistent backup image. DB2 includes all the require logs in the backup image when the transaction spreads across many log files, even when a log backup exists. If the logs are already backed up and deleted, DB2 will submit a log restore request to the DB2 iDataAgent.

There are three parameters you can use to control the log files actions.

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 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 for 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 for one transaction. To limit the number of files, set this parameter to the number of files.

Note: If you set both the max_log parameter and num_log_span parameter to 0, DB2 uses unlimited log space.

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 transaction 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 Additional Setting dword value as 1 on CommServe under the Resource Manager.

Can I restore an SnapProtect backup image on a disk using CommCell Console?

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.

Do I need to delete the online logs when performing a point-in-time restore?

Yes, before performing a point-in-time restore, you must delete the online logs or the restore will fail.

Command Line

How do I view the list of available backup Images from command line?

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]

Parameter Description
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

Examples

Expand All

Data Option

./qoperation execscript -sn QS_querydb2backup -si 'test-db2' -si 'db2inst1' -si 'NEW' -si 'DATA'

Output

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!

Log Option

./qoperation execscript -sn QS_querydb2backup -si 'test-db2' -si 'db2inst1' -si 'NEW' -si 'LOGS'

Output

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.

General

How do you archive and manage the logs in SnapProtect?

  1. When an online log is full, DB2 requests SnapProtect VENDOR Library API to archive the logs.
  2. By default, SnapProtect archives the logs in ARCHIVE_PATH specified during SnapProtect installation.
  3. 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.
  4. Configure the ARCHIVE PATH by using sDB2_ARCHIVE_PATH Additional Setting.

Can I enable DB2 triggered pruning for SnapProtect's DB2 iDataAgent?

Yes. You can enable DB2 triggered pruning for SnapProtect's DB2 iDataAgent by using sCvDB2EnablePruning Additional Setting.

Can I restore a load copy image directly on a database?

No. The DB2 server will not allow you to restore a load copy image directly on a database.

What does the return code 23 in db2diag.log indicate?

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.

What files are placed in the DB2 Audit Error directory and are they pruned?

The DB2 Audit Error path is created when you install the DB2 agent. When you perform a log backup, the SnapProtect software uses this directory to write temporary files that contain a reference to the logs. When you perform a restore, the SnapProtect software looks for these files first so that the restore can be more efficient. The files may be restored back. These files are pruned when they have not been accessed in a few days The file names have the format M_<archiveFileId>_<CommCellId> .