Options and Input File Parameters

The db2util.ps1 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. 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

This is theCommvaultinstance name.

-o

Target database name. This is an optional option. If you do not provide this option, Commvault assumes the source database name to use.

-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.

-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

To be specified for DPF clients

-i

Commvault Instance name

  • 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.ps1 for a single job id only. The last job id in one cycle will be only be considered.

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...