Configuration - DB2 iDataAgent

Table of Contents

Configuration Required for Database Administrators

If you have database administrators that perform backups and restores

  1. Configure a CommCell user with agent management capabilities for the database administrator.
  2. Configure a Storage Retention Policy for backups.

Set Up Permissions for the DB2 Database Administrator

  1. From the CommCell Browser, navigate to Security in the left pane.
  2. Right-click the CommCell Users, and then click New User.
  3. In the New User Properties dialog box, click the General tab.

    In the User Name box, enter the name of the new user account.

    In the Password box, enter the new password for the user account. Re-enter the password in the Confirm Password box.

    In the Full Name box, enter the full name of the user.

    In the Description box, enter the description of the user.

    In the E-Mail box, enter the email of the user.

    Click OK.
  4. From the CommCell Browser, navigate to Security.
  5. Right-click the CommCell User Groups and select the New User Group.
  6. In the New User Group Properties dialog box, click the General tab.

    Type the user group name in the Name box.

    In the Description box, enter the description of the user group.

  7. Click the Capabilities tab.

    Select Agent Management, Data Protection/Management Operations, In Place Recover, and Out of Place Recover capabilities.

    Click the  > button to move the selected capabilities to the Assigned Capabilities list box.

  8. Click the Users tab.

    Select the user from the Available Users list and move to the Member Users list.

  9. Click the Associated Entities tab.

    Expand the Client Computers node and select the client computers that you want to associate to this user group.

    Click OK.

DB2 Parameter Configuration

You must update the following DB2 database parameters to configure and protect the DB2 database with SnapProtect:

LOGARCHMETH1

Use this parameter to specify the SnapProtect library that will be used to archive and manage the DB2 database log files.

LOGARCHOPT1

Use this parameter to enable the DB2 to communicate with SnapProtect storage system during the Log archive and retrieve operations.

VENDOROPT – vendor

Use this parameter to enable the DB2 to communicate with SnapProtect storage system during backup, restore, or load copy operations.

TRACKMOD

Enable this parameter to allow the incremental/delta backups.

Automatically Updating DB2 Parameters

You can automatically update DB2 parameters (LOGARCHMETH1, LOGARCHOPT1, VENDOROPT, TRACKMOD) by using the Db2_config.sh script on Unix and Db2_config.ps1 script on Windows to perform backups and restores.

The following DB2 parameters are modified:

  • LOGARCHMETH1
  • LOGARCHOPT1
  • VENDOROPT
  • LOGARCHMETH2 to OFF
  • TRACKMOD to ON

Note: In a clustered environment, the Db2_config.sh script on Unix and Db2_config.ps1 script on Windows update the DB2 database configuration parameters on the physical node only.

The following table defines the parameters for both scripts.

Parameter Description
dbname The name of the DB2 database. This is required.
SnapProtect_Instance The name of the SnapProtect instance. This is optional. When you do not specify this parameter, the SnapProtect software uses Instance0001.

UNIX

This script is available in SnapProtect_path/iDataAgent on UNIX client. This script can be used to set the DB2 database configurations to use SnapProtect DB2 on UNIX iDataAgent to perform a data backup on a single node DB2 Instance, log backup and log archival. This script also checks if the instance user has read/write permissions to the Archive, Retrieve, and Audit error directories. You must be a DB2 instance user and need to be added to the UNIX group of SnapProtect to run this script.

Synopsis

Db2_config.sh -d <dbname> [-i <SnapProtect_instance>]

  1. Go to the DB2 Agent directory to locate the Db2_config.sh utility.
  2. On the command line, type the following command.

    Db2_config.sh -d <dbname> [-i <SnapProtect_instance>]

Expand All

Example:

# su - db2inst1
$ cd /opt/SnapProtect/iDataAgent
$ ./Db2_config.sh -d testdb -i Instance001
OPTIND is now 5
DBNAME=testdb INSTANCE=Instance001

Input:: DBNAME=testdb INSTANCE=Instance001

set_db_params
check_dir
get_db2_paths
/u01/database/db2/GDB2Archive
/u01/database/db2/GDB2Audit
/u01/database/db2/GDB2Retrieve
/u01/database/db2/GDB2Archive is accessible
/u01/database/db2/GDB2Retrieve is accessible
/u01/database/db2/GDB2Audit is accessible

get_base_dir
Base directory: /opt/simpana2/Base
DB2 User: db2inst1
DB2 Home: /home/db2inst1
DB2SYSC Path: /home/db2inst1/sqllib/adm/db2sysc
get_client_name
Client Name: ggux18
Executing:: db2 update db cfg for testdb using LOGARCHMETH1 VENDOR:/opt/SnapProtect/Base/libDb2Sbt.so
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
Executing:: db2 update db cfg for testdb using LOGARCHOPT1 CvClientName=ggux18,CvInstanceName=Instance001
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
Executing:: db2 update db cfg for testdb using VENDOROPT CvClientName=ggux18,CvInstanceName=Instance001
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
Executing:: db2 update db cfg for testdb using LOGARCHMETH2 OFF
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
Executing:: db2 update db cfg for testdb using TRACKMOD ON
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
<<<<<<<<<ENDED>>>>>>>>>
$

If you update the LOGARCHOPT1 parameters, you must restart the database after running this script.

Windows

This script is available in SnapProtect_path\Base on Windows clients. This script can be used to set the DB2 database configurations to use SnapProtect DB2 on the Windows iDataAgent to perform a data backup on a single node DB2 Instance, log backup and log archival. This script also checks if the instance user has read and write permissions to the Archive, Retrieve, and Audit error directories. You must be a DB2 instance user to run this script.

Synopsis

Db2_config.ps1 -d <dbname> [-i <SnapProtect_instance>]

Use the following steps to run this script from the DB2 command line prompt:

  1. On the Windows client computer command line, type the following command.

    qlogin -cs <commserve_name> -u <commcell_user_name> -p <commcell_login_password>

  2. Run the Windows PowerShell  from the DB2 command prompt window.
  3. Enable PowerShell script execution on the system:

    Set-ExecutionPolicy Unrestricted

  4. In the SnapProtect_path\Base directory, at the PowerShell prompt, type the following command.

    Db2_config.ps1 -d <dbname>

  5. At the PowerShell prompt, disable the PowerShell script execution on the system:

     Set-ExecutionPolicy Restricted

See Automatically updating DB2 parameters for more information.

Interactively Updating the DB2 Parameters

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 the business requirements for the database.

Update the database configuration parameters when the DB2 agent is installed on a cluster or multiple instances of  SnapProtect are installed.

See Interactively Updating the DB2 Parameters for more information.

DB2 Initial Configuration on the CommCell Console

You must perform the following tasks before you perform your first backup.

  1. Configure a Storage Retention Policy for backups.
  2. Discover the DB2 instances.
  3. Update the DB2 instances with the appropriate credentials for accessing the DB2 application.
  4. Configure the subclient storage policies.

Discovering DB2 Instances

Note: You must have the DB2 Administrative privileges to configure the instances.

Use the following to discover all existing DB2 instances.

  1. From the CommCell Browser, expand Client Computers > client.
  2. Right-click DB2, point to All Tasks and then click Discover Instance.
  3. Click Yes to confirm the instance discovery.

Backup sets with the name of the discovered databases are listed under the DB2 instance.

Configuring the DB2 account to access the DB2 application

Use the following to modify the user account associated with the DB2 instance to access the DB2 application

  1. Right-click the <DB2 Instance>, and then click Properties.

  2. On the General Tab of the Properties dialog box, under the DB2 User Account box, click Change and type the user name to access the DB2 application.

    For Windows clients, enter the domain name along with the user name.

    In the Password box, type the password for the user account.

    In the Confirm Password box, retype the password for the user account.

    Click OK.

Configuring the Subclient Storage Policies

  1. From the CommCell Browser, navigate to Client Computers |< Client > | DB2 | <Instance> | <Backup_Set>
  2. Right-click the <Subclient>, and then click Properties.
  3. On he Storage device tab of the Subclient Properties dialog box, click the Data Storage Policy Tab and select the Storage Policy.