Database Readiness Check - DB2 DataAgent

Table of Contents

Introduction

The Database Readiness Check verifies the pre-requisites are met for the DB2 DataAgent to successfully perform backups and restores.  It is available on Unix clients.

It verifies the following:

  1. The database user has read/write permissions on the SnapProtect registry, log files and base directories.
  2. The database user is a member of the  SnapProtect install group as recommended.

The Database Readiness Check is run from the command line on the client. It can run with the verify option, or the fix option which interactively fixes the permission failures. If the fixes require the SnapProtect services to be restarted, the Database Readiness Check automatically handles the restart.

Running the Database Readiness Check

For a root install, the Database Readiness Check uses root credentials to access the CommServe  For a non-root install, the Database Readiness Check prompts for the CommCell GUI credentials to access the CommServe.

Navigate to the  Simpana_Install_Dir/iDataAgent directory and execute the following command.

./DBAgentReadinessCheck.sh -o <fix|verify> -f <log_file_full_path>

Option Description
o Specify whether the Database Readiness Check will verify or fix the permissions.
  • verify - This is the default option and performs the verification as specified in the Introduction.
  • fix - This option fixes the permissions.
f Specify the full path for the log file.  The default log file path is "/tmp/CV_DBAgentReadinessCheck.log".

When using the Database Readiness Check, follow these steps.

  1. Run it with the verify option.
  2. Check the output. If there are no failed cases, then the database agent is ready for backup and restore operations.
  3. If there are permission failures, use the  -o fix option to correct the database user permissions. The Database Readiness Check prompts for a user confirmation before changing the permissions.  See Example of Fixing the Database User Permissions.

Example of a Database Agent Ready for Backups and Restores

This is an example of the Database Readiness Check showing the database agent is ready.

 -  ... [OK] -  ... [OK] - /opt/simpana2/simpana/Base/certificates ... [OK] -

[root@dbserve4 iDataAgent]# ./DBAgentReadinessCheck.sh -o verify
****************************************************************
Tool: Check Readiness of "Database Agents"
****************************************************************
- Simpana instance: [Instance001]
- Simpana install group: [dba]
- Simpana database agents installed:
- DB2 Agent:
   - Instance: [db2inst1] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst2] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst3] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst4] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst5] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst7] DbHome  [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst8] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part1] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part2] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part3] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part4] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part5] DbHome: [/database/db2/V9.1B64/db2inst1]
Checking [DB2] Agent Readiness
*****************************************
- Database user name:[db2inst7]
- Database home: [/database/db2/V9.1B64/db2inst1]
- Check if user is member of Simpana install group [dba] ... [OK]
- Check if install group has (Read & Write) permissions on:
   - /opt/simpana2/simpana/Base/Temp ... [OK]
   - /etc/CommVaultRegistry ... [OK]
   - /var/log/simpana/Log_Files ... [OK]
   - /opt/simpana2/simpana/iDataAgent/jobResults ... [OK]
   - /opt/simpana2/simpana/iDataAgent/Base/certificates ... [OK]
   - /export/home/db2/db2path/lin_friendly/db2Archive ... [OK]
   - /export/home/db2/db2path/lin_friendly/db2Retrieve ... [OK]
##############################################
#### ##### DB2 Agent is READY #####
##############################################
Exiting the tool. Please check logs at /tmp/CV_DBAgentReadinessCheck.log

Example of a Database Agent not Ready for Backups and Restores

This is an example of running the Database Readiness Check with the verify option.  In this example errors are indicated by "[FAILED]".

[root@dbserve4 iDataAgent]# ./DBAgentReadinessCheck.sh -o verify
****************************************************************
Tool: Check Readiness of "Database Agents"
****************************************************************
- Simpana instance: [Instance001]
- Simpana install group: [dba]
- Simpana database agents installed:
- DB2 Agent:
   - Instance: [db2inst1] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst2] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst3] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst4] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst5] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst7] DbHome  [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst8] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part1] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part2] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part3] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part4] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part5] DbHome: [/database/db2/V9.1B64/db2inst1]
Checking [DB2] Agent Readiness
*****************************************
- Database user name:[db2inst7]
- Database home: [/database/db2/V9.1B64/db2inst1]
- Check if user is member of Simpana install group [dba] ... [OK]
- Check if install group has (Read & Write) permissions on:
   - /opt/simpana2/simpana/Base/Temp ... [FAILED]
   - /etc/CommVaultRegistry ... [OK]
   - /var/log/simpana/Log_Files ... [OK]
   - /opt/simpana2/simpana/iDataAgent/jobResults ... [OK]
   - /opt/simpana2/simpana/iDataAgent/Base/certificates ... [OK]
   - /export/home/db2/db2path/lin_friendly/db2Archive ... [OK]
   - /export/home/db2/db2path/lin_friendly/db2Retrieve ... [OK]
##############################################
#### DB2 Agent is NOT READY ####
##############################################
Please correct the FAILED checks.
Please see [/tmp/CV_DBAgentReadinessCheck.log] for more details.

Example of Fixing the Database User Permissions

This option presents changes that must be approved.  See the lines in bold starting with "WARNING".

If restarting the DB2 services is required, the Database Readiness Check automatically handles it.

[root@dbserve4 iDataAgent]# ./DBAgentReadinessCheck.sh -o fix
****************************************************************
Tool: Check Readiness of "Database Agents"
****************************************************************
- Simpana instance: [Instance001]
- Simpana install group: [dba]
- Simpana database agents installed:
- DB2 Agent:
   - Instance: [db2inst1] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst2] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst3] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst4] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst5] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst7] DbHome  [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2inst8] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part1] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part2] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part3] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part4] DbHome: [/database/db2/V9.1B64/db2inst1]
   - Instance: [db2part5] DbHome: [/database/db2/V9.1B64/db2inst1]
Checking [DB2] Agent Readiness
*****************************************
- Database user name:[db2inst7]
- Database home: [/database/db2/V9.1B64/db2inst1]
- Check if user is member of Simpana install group [dba] ... [OK]
- Check if install group has (Read & Write) permissions on:
   - /opt/simpana2/simpana/Base/Temp ... [FAILED]
   - /etc/CommVaultRegistry ... [OK]
   - /var/log/simpana/Log_Files ... [OK]
   - /opt/simpana2/simpana/iDataAgent/jobResults ... [OK]
   - /opt/simpana2/simpana/iDataAgent/Base/certificates ... [OK]
   - /export/home/db2/db2path/lin_friendly/db2Archive ... [OK]
   - /export/home/db2/db2path/lin_friendly/db2Retrieve ... [OK]
##############################################
#### DB2 Agent is NOT READY ####
##############################################
Please correct the FAILED checks.
Please see [/tmp/CV_DBAgentReadinessCheck.log] for more details.
Fixing database group [dba] permissions
*****************************************
WARNING!! Group [dba] will be given WRITE permissions. Please answer [y/n] to proceed: ?y
Using installer version 10116174.
Assigning setup GUID ... 10-116-dbserve4.devemc.commvault.com-172.19.65.247-19602
Stopping Simpana services for db2inst1 ...

Simpana 10 (BUILD116) Change
Changing Unix Group for db2inst1

Changing group to dba for the following directories...
- Registry(/etc/CommVaultRegistry) ... done.
- Logs(/var/log/simpana/Log_Files) ... done.
- Certificates(/opt/simpana2/simpana/iDataAgent/Base/certificates) ... done.
- Job Results for dbserve4(/opt/simpana2/simpana/iDataAgent/jobResults) ... done.
- DB2 Archive Path (/export/home/db2/db2path/lin_friendly/db2Archive) ... done
- DB2 Retrieve Path (/export/home/db2/db2path/lin_friendly/db2Retrieve) ... done
Updating /opt/simpana2/simpana/Base/Temp/pkginfo for GALAXY_GROUP=dba ... done.
Updating /opt/simpana2/simpana/Base/Temp/pkginfo for GALAXY_GROUP=dba ... done.

Simpana 10 (BUILD116) Change
Changing Group and Other User's Access Permissions for Instance004

Changing access permissions for group users to 7 and other users to 5 for the following directories...
- Registry(/etc/CommVaultRegistry) ... done.
- Logs(/var/log/simpana/Log_Files) ... done.
- Certificates(/opt/simpana2/simpana/iDataAgent/Base/certificates) ... done.
- Job Results for dbserve4(/opt/simpana2/simpana/iDataAgent/jobResults) ... done.
- DB2 Archive Path (/export/home/db2/db2path/lin_friendly/db2Archive) ... done
- DB2 Retrieve Path (/export/home/db2/db2path/lin_friendly/db2Retrieve) ... done
Updating /opt/simpana2/simpana/Base/Temp/pkginfo for GALAXY_GROUP=dba ... done.
Updating /opt/simpana2/simpana/Base/Temp/pkginfo for GALAXY_GROUP=dba ... done.
Updating  /opt/simpana2/simpana/Base/pkginfo for GALAXY_OTHER_ACCESS=5 ... done.
Updating  /opt/simpana2/simpana/Base0/pkginfo for GALAXY_OTHER_ACCESS=5 ... done.
Updating  /opt/simpana2/simpana/Base/pkginfo for GALAXY_GROUP_ACCESS=7 ... done.
Updating  /opt/simpana2/simpana/Base0/pkginfo for GALAXY_GROUP_ACCESS=7 ... done.
Cleaning up /opt/simpana2/simpana/Base ...
Starting Simpana services for db2inst1 ...

Simpana 10 (BUILD116) Change
Done

[ PLEASE READ THE FOLLOWING NOTES ]
(1) Depending on the file type, the actual permission might be more restrictive.
For example, a text file may not have executable bit on.

(2) If you run installer to add more instances or modules, you might need to
rerun this utility to fix certain files changed during the install.
Thank you for using CommVault Systems, Inc. Simpana.