Modifying DB2 Database Instance Properties Using the Commvault Command Line Interface

Use XML to modify DB2 database instance properties. Run the operation from the command line, or automate configuration by combining command line operations in a script.

You can include the XML parameters in the xml file, or you can specify them on the command line when they frequently change. For more information on command line parameters and XML elements, see Command Line - Syntax.

Procedure

  1. On the DB2 Agent host, run the qlogin command to log on to the CommServe computer.

  2. Download the UpdateInstance_Template.xml file to the computer where you will run the command.

  3. Open the UpdateInstance_Template.xml file, add your specific parameters, and save the file.

    For information on supported subclient XML parameters, see Available XML Parameters for DB2 Instance Configuration.

  4. On the command line, go to Software_Installation_Directory/Base and type the command.

    UNIX

    qoperation execute -af UpdateInstance_Template.xml -instanceName '<db2instance_name>' -description '<description>' -clientName '<client_name>'-appName 'DB2 on Unix' -commandLineStoragePolicy/storagePolicyName 'command_line_storage_policy' -logBackupStoragePolicy/storagePolicyName 'log_line_storage_policy' -dataBackupStoragePolicy/storagePolicyName 'data_storage_policy'

    Windows

    qoperation execute -af UpdateInstance_Template.xml -instanceName '<db2instance_name>' -description '<description>' -clientName '<client_name>'-appName 'DB2' -commandLineStoragePolicy/storagePolicyName 'command_line_storage_policy' -logBackupStoragePolicy/storagePolicyName 'log_line_storage_policy' -dataBackupStoragePolicy/storagePolicyName 'data_storage_policy' -domainName '<domain_name>' -userName '<user_name>' -password '<password>' -homeDirectory '<home_directory>'

  5. Run the qlogout command to log off the CommServe computer.

Examples

Updating a Data Storage Policy on an Instance on a DB2 Windows Configuration

To update the data backup storage policy, set the following parameters:

Parameter

Value

instanceName

The instance name. In this example, 'db2instance_name'.

clientName

The DB2 client name. In this example, 'db2_client'.

appName

In this example, 'DB2'.

dataBackupStoragePolicy/storagePolicyName

'The data backup storage policy. In this example, 'SP3'.

qoperation execute -af UpdateInstance_Template.xml -instanceName 'db2instance_name' -clientName 'db2_client' -appName 'DB2' -dataBackupStoragePolicy/storagePolicyName 'new_storage_policy'

Adding Test Group 2 and Deleting Test Group 1 on DB2 UNIX Configuration

To update the groups, set the following parameters:

Parameter

Value

instanceName

The instance name. In this example, 'db2instance_name'.

clientName

The DB2 client name. In this example, 'db2_client'.

appName

In this example, 'DB2 on Unix'.

userGroupName

In this example, 'test2'.

associatedUserGroupsOperationType

In this example, 'ADD'.

userGroupName

In this example, 'test1'.

associatedUserGroupsOperationType

In this example, 'DELETE'.

qoperation execute -af UpdateInstance.xml -instanceName 'db2instance_name' -clientName 'db2_client' -appName 'DB2 on Unix' -userGroupName 'test2' -associatedUserGroupsOperationType 'ADD' -userGroupName 'test1' -associatedUserGroupsOperationType 'DELETE'

Updating the DB2 Home Path on a DB2 UNIX Configuration

To update the home directory, set the following parameters:

Parameter

Value

instanceName

The instance name. In this example, 'db2instance_name'.

clientName

The DB2 client name. In this example, 'db2_client'.

appName

In this example, 'DB2 on Unix'.

homeDirectory

In this example, 'Z:\DB2V9.7\SQLLIB'.

qoperation execute -af afUpdateInstance_Template.xml -instanceName 'db2instance_name' -clientName 'db2_client' -appName 'DB2 on Unix' -homeDirectory 'Z:\DB2V9.7\SQLLIB'

Updating DB2 User Credentials on a DB2 Windows Configuration

To update the user credentials, set the following parameters:

Parameter

Value

instanceName

The instance name. In this example, 'db2instance_name'.

clientName

The DB2 client name. In this example, 'db2_client'.

appName

In this example, 'DB2 '.

domainName

In this example, 'db2_test_domain'.

userName

In this example, 'administrator'.

password

In this example, 'abcd'.

qoperation execute -af UpdateInstance_Template.xml -instanceName 'db2instance_name' -clientName 'db2_client' -appName 'DB2' -domainName 'db2_test_domain' -userName 'administrator' -password 'abcd'

Loading...