Configuration - Database Administrator Configuration
Perform the following for DB2 database administrators that perform backup and restore operations:
-
A DB2 user must have SYSADM, SYSCTRL, or SYSMAINT and DBADM privileges to run backup and restore operations. For more details, refer to the IBM Knowledge Center website.
Initially, the user account credentials are provided during the instance configuration after the installation of the agent. You can subsequently change the user account information to access the DB2 database and application at the database instance level whenever the credentials are updated. The user which is specified at the DB2 instance level property can manage all databases under the DB2 instance; however, you can specify separate DB2 users for specific databases at the backup set level.
-
Configure a CommCell user with agent management capabilities for the database administrator.
DB2 Parameter Configuration
You must update the following DB2 database parameters to configure and protect the DB2 database with Commvault:
LOGARCHMETH1
Use this parameter to specify the Commvault 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 Commvault storage system during the Log archive and retrieve operations.
VENDOROPT – vendor
Use this parameter to enable the DB2 to communicate with Commvault 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 by using the Db2_config.sh script on Unix and the 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 or the Db2_config.ps1 script on Windows updates the DB2 database configuration parameters on the physical node only. You must manually update the CvClientName from the physical node name to the VM client name for the LOGARCHOPT1 and VENDOROPT parameters.
The following table defines the parameters for both scripts.
Parameter |
Description |
---|---|
dbname |
The name of the DB2 database. This is required. |
Commvault_Instance |
The name of the Commvault instance. This is optional. When you do not specify this parameter, the Commvault software uses Instance001. |
UNIX
This script is available in Commvault_path/iDataAgent on the UNIX client. This script can be used to set the DB2 database configurations to use Commvault 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 Commvault to run this script.
Synopsis
Db2_config.sh -d <dbname> [-i <Commvault_instance>]
-
Go to the DB2 Agent directory to locate the Db2_config.sh utility.
-
On the command line, type the following command.
Db2_config.sh -d <dbname> [-i <Commvault_instance>]
Example:
# su - db2inst1
$ cd /opt/Commvault/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/commvault/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/Commvault/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 Commvault_path\Base on Windows clients. This script can be used to set the DB2 database configurations to use Commvault 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 <Commvault_instance>]
Use the following steps to run this script from the DB2 command line prompt:
-
On the Windows client computer command line, type the following command.
qlogin -cs <commserve_name> -u <commcell_user_name> -p <commcell_login_password>
-
Run the Windows PowerShell from the DB2 command prompt window.
-
Enable PowerShell script execution on the system:
Set-ExecutionPolicy Unrestricted
-
In the Commvault_path\Base directory, at the PowerShell prompt, type the following command.
Db2_config.ps1 -d <dbname>
-
At the PowerShell prompt, disable the PowerShell script execution on the system:
Set-ExecutionPolicy Restricted
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 Commvault are installed.
For more information, see Setting the DB2 Configuration Parameters.
DB2 Initial Configuration on the CommCell Console
You must perform the following tasks before you perform your first backup.
-
Configure a Storage Retention Policy for backups.
-
Discover the DB2 instances.
-
Update the DB2 instances with the appropriate credentials for accessing the DB2 application.
-
Configure the subclient storage policies.
Discovering DB2 Instances
Note: You must have DB2 Administrative privileges to configure the instances.
Use the following to discover all existing DB2 instances.
-
From the CommCell Browser, expand Client Computers > client.
-
Right-click DB2, point to All Tasks and then click Discover Instance.
-
Click Yes to confirm the instance discovery.
Configuring the DB2 Instance
Configuring the DB2 Account
Modify the user account associated with the DB2 instance to access the DB2 application:
-
Right-click the <DB2 Instance>, and then click Properties.
-
On the General Tab of the Properties dialog box, under the DB2 User Account box, and click Change.
-
Type the user name to access the DB2 application. For Windows clients, include 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 Policy
Configure the subclient storage policy for the instance:
-
From the CommCell Browser, navigate to Client Computers |< Client >| DB2| <Instance> | <Backup_Set>.
-
Right-click the <Subclient>, and then click Properties.
-
On the Storage device tab of the Subclient Properties dialog box, click the Data Storage Policy tab and select the Storage Policy.
Discovering DB2 Databases (Backup Sets)
Discover the databases associated with the instance:
-
From the CommCell Browser, navigate to Client Computers |< Client >| DB2| <Instance>.
-
Right-click the <Instance>, and then click All Tasks > Discover Databases.
Backup sets with the name of the discovered databases are listed under the DB2 instance.