# Options and Input File Parameters

The db2util.sh utility supports the following options and input file parameters.

## Query Options

The following options are available when you want to query Commvault for backup information.

Option | Description
--- | ---
-q | Query operation Valid values are: ALL, for all data and logs LOG, for logs backup history DATA, for database backup history
-c | This is the client name presented on the CommCell Console. For a cluster setup, this client name is virtual machine client name.
-s | This is the DB2 instance name
-d | This is the DB2 database name
-i | The Commvault instance name. If you do not specify a Commvault Instance, then Instance001 is used.
-o | This is optional. The target database name. If a target database name is not provided, the source database name is used.
-r | Retrieves the log files under the db2 retrieve path.
-f | The start date and time to include in the query. Enclose the date and time in single quotation marks and use the following format: MM-DD-YYYY hh:mm:ss For example, '01-11-2019 10:00:00' Use the -f option with the -t option. Note The date and time is the client computer date and time, not the date and time from the Commserve computer or from the computer used to access the client. If there are archive logs generated in the time range, but there is no log backup job in the time range, the next log backup job is returned even though the backup job is not actually in the time range.
-t | The end date and time to include in the query. Enclose the date and time in single quotation marks and use the following format: MM-DD-YYYY hh:mm:ss For example, '04-11-2019 10:00:00' Use the -t option with the -f option.
-a | Name of the file containing the script input parameters
-h | Prints usage information

## Restore Options

The following options are available when you want to restore the data.

Option | Description | Additional Information
--- | --- | ---
-r | Restore operation Valid values are: LOG, to restore logs to retrieve directory JOB, to restore data and logs to a disk based on the backup job ID. The logs are restored if the backup job ID contains logs. | When the -r JOB option is used, a new folder with the restore job ID is created on the local computer in the directory specified in the -p option. The backup image and DB2 logs are restored under this job ID folder. If the -p option is not used, a new folder with the folder name dump_<JOB_ID> is created under software_installation_directory\Base. The utility restores the backup image to this directory. If you do not require the backup images, you must manually clean the dump_<JOB_ID> folder. When the -r LOG option is used, the -p target location is ignored. By default, the DB2 retrieve path is used for the log file restore location. The -r LOG option requires both -f and -t for DB2 archive log beginning sequence # and last sequence #.
-d | Name of database to be restored |
-j | Backup job ID for the data or log to be restored. | The IntelliSnap (non-traditional DB2 backup image) is not supported when you provide the job ID. All job IDs must be for traditional DB2 jobs.
-f | Start Log Sequence number | If you use -r JOB, the -f and -t options for the range of DB2 logs is ignored.
-t | End Log sequence number
-p | The destination path. This is a mandatory parameter for Windows configurations. You must specify this parameter to have the software restore the DB2 backup image files to the location. |
-s | Source Db2 instance name |
-c | Source client name |
-n DPF | Use this when you have a DB2 DPF configuration. |
-i | The Commvault instance name. If you do not specify a Commvault Instance, then Instance001 is used. |
-a | Name of the file containing the script input parameters |

- Use this query on a cross-machine restore to query and restore the backup image to the location. You must install the DB2 application and DB2 Agent on the destination. The DB2 version must be the same or higher.

- Commvault supports restoring the backup image to disk using db2util.sh for a single job ID only.

## Input File Parameters

You can specify the following parameters in an input file.

Parameter | Description
--- | ---
CVSRCCLIENTNAME | Source client name
CVSRCDB2INSTANCENAME | Source DB2 instance name
OPERATION | Specify an operation QA/QL/QD(QUERY) or RL/RJ(RESTORE) to be performed on database
RESTOREDIR | Directory where the backup job data is restored. This option is valid when OPERATION is set to RJ.
JOBID | Backup job ID for the data to be restored
DBNAME | Database name
APPLICATION DPF | Only for DPF
FROMLSN | The from log number
TOLSN | The to log number

×

Loading...