Command Line Interface - Configuration - PostgreSQL iDataAgent

Configuration Backup Restore
Table of Contents

Log On to the CommServe

To run command line operations, you must first login to the CommServe.

From Command prompt, navigate to <Software_Installation_Directory>/Base and run the following command:

qlogin -cs <commserve name> -u <user name>

For example, to log on to CommServe 'server1' with username 'user1':

qlogin -cs server1 -u user1

Instance Configuration

Adding an Instance

  1. Download the create_instance_template.xml file and save it on the computer from where the command will be executed.
  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameter values.

    qoperation execute -af create_instance_template.xml -appName 'PostgreSQL' -clientName 'xxxxx' -instanceName 'xxxxx' -description 'xxxxx' -MaintainenceDB 'xxxxx' -BinaryDirectory 'xxxxx' -LibDirectory 'xxxxx' -ArchiveLogDirectory 'xxxxx' -port 5434 -userName 'xxxxx' -password 'xxxxx' -ArchiveDelete true -storagePolicyName 'xxxxx' -userGroupName 'xxxxx' -associatedUserGroupsOperationType ADD

Modifying an Instance

  1. Download the modify_instance_template.xml file and save it on the computer from where the command will be executed.
  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameter values.

    qoperation execute -af modify_instance_template.xml -appName 'PostgreSQL' -clientName 'xxxxx' -instanceName 'xxxxx' -description 'xxxxx' -MaintainenceDB 'xxxxx' -BinaryDirectory 'xxxxx' -LibDirectory 'xxxxx' -ArchiveLogDirectory 'xxxxx' -port 5434 -userName 'xxxxx' -password 'xxxxx' -ArchiveDelete true -storagePolicyName 'xxxxx' -userGroupName 'xxxxx' -associatedUserGroupsOperationType DELETE

Getting Instance Properties

  1. Download the get_instance_properties_template.xml file and save it on the computer from where the command will be executed.
  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.

    qoperation execute -af get_instance_properties_template.xml -appName 'PostgreSQL' -clientName 'xxxxx' -instanceName 'xxxxx'

Deleting an Instance

Warning: If you do not include the instanceName parameter when you delete instances, all PostgreSQL instances are deleted for the client.

  1. Download the delete_instance_template.xml file and save it on the computer from where the command will be executed.
  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.

    qoperation execute -af delete_instance_template.xml -appName 'PostgreSQL' -clientName 'xxxxx' -instanceName 'xxxxx'

Available Parameters for Instance Configuration

The following table displays all the parameters you can use with the commands mentioned in the above sections. To add a parameter to your command, use the following syntax: (A example is provided at the end of the table.)

qoperation execute -af <template XML file> -<parameter name> <value>

Parameter Description of Parameter Values
description A general description of the instance.
clientName Name of the client computer, as displayed in the CommCell Browser.
appName Name of the application. In this case it would be 'PostgreSQL'.
instanceName Name of the PostgreSQL instance.
MaintainenceDB Name of the system database which is used as maintenance DB.
BinaryDirectory Path to the binary directory of the instance.
LibDirectory Path to the library directory of the instance.
ArchiveLogDirectory Path to the archive log directory of the instance.
port Port to open communication between the PostgreSQL Server and the clients.
userName User name to access the PostgreSQL application.
password Password for the PostgreSQL user account.
ArchiveDelete Option to enable or disable archive log deletion after backup. Valid values are True/False.
userGroupName Name of the user group associated to the instance.
associatedUserGroupsOperationType Specifies the operation performed on the user group. Valid values are:
  • ADD - To add a new user group.
  • OVERWRITE - To change the existing user group.
  • DELETE - To delete a user group.
storagePolicyName Name of the storage policy used for transaction log backups.

The following example shows how to add a parameter for a command:

Change the Instance Name

qoperation execute -af modify_instance_template.xml -appName 'PostgreSQL' -clientName 'client1' -instanceName 'instance1' -newName 'instance2'

Remove a User Group from the Instance Association

qoperation execute -af modify_instance_template.xml -appName 'PostgreSQL' -clientName 'client1' -instanceName 'instance1' -userGroupName 'xxxxx' -associatedUserGroupsOperationType DELETE

Backup Set Configuration

qinfo backupset

Description

This command displays information about a given backup set. If the agent supports instances above backup sets, only the backup sets under the specified instance are listed.

In case of an error, an error code and description are displayed as: "backupset: Error errorcode: errordescription"

Usage

qinfo backupset -c client -a dataagenttype -i instance -b backupset [-desc] [-tf tokenfile] [-tk token] [-h]

Options

-c Client computer name
-a Agent type installed on client computer (see Argument Values - Agent Types)
-i Instance name, required for a few agents
-b Backup set name
-desc Displays description provided by the user

To display the entire user description for the backup set without any other information, be sure to include the -desc option when you run the command. Otherwise, all the requested information along with only a partial description will be displayed.

-tf Reads token from a file
-tk Token string
-h Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Example

Display information about a backup set DumpBasedBackupSet in client client1 and Agent Q_POSTGRESS.

qinfo backupset -c client1 -a Q_POSTGRESS -i instance1 -b DumpBasedBackupSet

Sample Output:

Name         : DumpBasedBackupSet
Default      : Yes
OnDemand     : No
Description  : DumpBasedBackupSet description

qlist backupset

Description

This command lists the names of all the backup sets in the specified client and agent. If the agent supports instances above the backup set level, then only the backup sets under the specified instance are listed. Whenever more than one backup set is found, each backup set is listed in its own line on the command prompt. No message is displayed whenever backup sets are not found.

In case of an error, an error code and description are displayed as: "backupset: Error errorcode: errordescription"

Usage

qlist backupset -c client -a dataagenttype -i instance [-tf tokenfile][-tk token] [-h]

Options

-c Client computer name
-a Agent type installed on client computer (see Argument Values - Agent Types)
-i Instance name, required for certain agents
-tf Reads token from a file
-tk Token string
-h Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Example

List all the Backup sets in the client client1, agent Q_POSTGRESS.

qlist backupset -c client1 -i instance1 -a Q_POSTGRESS

The output for the qlist backupset command is:

DumpBasedBackupSet
FSBasedBackupSet

Subclient Configuration

Creating a Subclient

  1. Download the create_subclient_template.xml file and save it on the computer from where the command will be executed.
  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.

    qoperation execute –af create_subclient_template.xml -appName 'PostgreSQL' -clientName 'xxxxx' -instanceName 'xxxxx' -backupsetName 'xxxxx' –subclientName 'xxxxx' -dataBackupStoragePolicy/storagePolicyName 'xxxxx' -postgreSQLContent/databaseName 'xxxxx' -contentOperationType ADD

Modifying a Subclient

  1. Download the modify_subclient_template.xml file and save it on the computer from where the command will be executed.
  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.

    qoperation execute –af modify_subclient_template.xml -appName 'PostgreSQL' -clientName 'xxxxx' -instanceName 'xxxxx' –backupsetName 'xxxxx' –subclientName 'xxxxx' -dataBackupStoragePolicy/storagePolicyName 'xxxxx' -postgreSQLContent/databaseName 'xxxxx' -contentOperationType ADD | OVERWRITE | DELETE

Getting Subclient Properties

  1. Download the get_subclient_properties_template.xml file and save it on the computer from where the command will be executed.
  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.

    qoperation execute –af get_subclient_properties_template.xml -appName 'PostgreSQL' -clientName 'xxxxx' -instanceName 'xxxxx' -backupsetName 'xxxxx' -subclientName 'xxxxx'

Deleting a Subclient

Warning: If you do not include the subclientName parameter when you delete subclients, all user-created PostgreSQL subclients are deleted for the PostgreSQL backup set.

  1. Download the delete_subclient_template.xml file and save it on the computer from where the command will be executed.
  2. Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.

    qoperation execute –af delete_subclient_template.xml -appName 'PostgreSQL' -clientName 'xxxxx' -instanceName 'xxxxx' –backupsetName 'xxxxx' -subclientName 'xxxxx'

Available Parameters for Subclient Configuration

The following table displays all the parameters you can use with the commands mentioned in the above sections. To add a parameter to your command, use the following syntax: (Some examples are provided at the end of the table.)

qoperation execute -af <template XML file> -<parameter name> <value>

Parameter Description of Parameter Values
appName Name of the application. In this case it would be 'PostgreSQL'.
clientName Name of the client computer.
instanceName Name of the PostgreSQL instance.
backupsetName Name of the PostgreSQL backupset. Valid values are:
  • DumpBasedBackupset
  • FSBasedBackupset
subclientName Name of the PostgreSQL subclient.
enableBackup Option to enable backup of Subclient.

Valid values are True/False.

collectObjectListDuringBackup To enable/disable object list collection during backup.
networkAgents Number of Network Agents.
encryptionFlag Option to set the encryption points during backups. Valid values are:
  • ENC_MEDIA_ONLY, to encrypt the backup data after transmission and prior to storage on the media.
  • ENC_NETWORK_AND_MEDIA, to encrypt the backup data before transmission. The data is stored encrypted on the media.
  • ENC_NETWORK_ONLY, to encrypt the backup data before transmission and then decrypt the data prior to storage on the media.
  • ENC_NONE, to disable data encryption.
softwareCompression Option to enable compression on the Client or MediaAgent computer. Valid values are:
  • ON_CLIENT, to enable software compression on the client.
  • ON_MEDIAAGENT, to enable software compression on the MediaAgent.
  • OFF, to disable software compression.
dataBackupStoragePolicy/storagePolicyName Name of Storage Policy to be associated for backup.
enableDeduplication Option to enable deduplication on subclient.

Valid values are True/False.

generateSignature A component of deduplication performed on the client or MediaAgent computer. Valid values are:
  • ON_CLIENT, to enable signature generation on the client.
  • ON_MEDIA_AGENT, to enable signature generation on the MediaAgent.
  • OFF, to disable signature generation.
postgreSQLSubclientProp/numberOfBackupStreams Option to change the number of streams for data backup.
postBackupCommand Path to the post process script that will be run after the backup.
preBackupCommand Path to the pre process script that will be run before the backup.
runAs Option to specify the user name who has permissions to run the pre/post process scripts. Valid values are:
  • USE_IMPERSONATION, to specify a user with enough privileges to run the scripts. When using this value, you also need to provide the user credentials:

    -prepostUserName/userName <user name> -prepostUserName/password <password>

  • USE_LOCAL_SYS_ADMIN, to use the administrator account to run the scripts.
runPostBackup Option to run a process after backup completes.

Valid values are Yes/No.

impersonateUser/userName User name of the account that has the required privileges to access the data on a network share when specifying UNC paths for the subclient content.
impersonateUser/password Password of the account that has the required privileges to access the network share. This parameter must be used along with the 'impersonateUser/userName' parameter.
postgreSQLContent/databaseName Name of the database to be added as subclient content.

  • Content cannot be added to default subclients.
  • Content can only be added to user-defined subclients of DumpBasedBackupSet.

contentOperationType Option to add, modify or delete the subclient content. Valid values are:
  • ADD, to add the subclient content.
  • OVERWRITE, to modify the subclient content.
  • DELETE, to delete the subclient content.

The following examples show how to add a parameter for a command:

Enable Backup To enable backup for a subclient, add the 'enableBackup' parameter to the following command:

qoperation execute –af  modify_subclient_template.xml -appName 'PostgreSQL' -clientName 'client1' -instanceName 'instance1' –backupsetName 'backupset1' –subclientName 'subclient1' -enableBackup true

Setting a Storage Policy To assign a storage policy to a subclient, add the 'storagePolicyName' parameter to the following command:

qoperation execute –af modify_subclient_template.xml -appName 'PostgreSQL' -clientName 'client1' -instanceName 'instance1' –backupsetName 'backupset1' –subclientName 'subclient1' -dataBackupStoragePolicy/storagePolicyName 'SPdata'

qinfo subclient

Description

This command displays information about a subclient under a specified client, agent, and instance/backup set. The backup set name and instance name should be specified based on the agent, as certain agents place subclients under backup sets, and others place them under the instance.

In case of an error, an error code and description are displayed as: "subclient: Error errorcode: errordescription"

Usage

qinfo subclient -c client -a dataagenttype -i instance -b backupset -s subclient [-desc] [-tf tokenfile] [-tk token] [-h]

Options

-c Client computer name
-a Agent type installed on client computer (see Argument Values - Agent Types)
-i Instance name, required for a few agents
-b Backup set name, required for a few agents
-s Subclient name
-desc Displays description provided by the user

To display the entire user description for the backup set without any other information, be sure to include the -desc option when you run the command. Otherwise, all the requested information along with only a partial description will be displayed.

-tf Reads token from a file
-tk Token string
-h Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Example

Display information about the default subclient in the client client1, Agent Q_POSTGRESS and backup set DumpBasedBackupSet.

qinfo subclient -c client1 -a Q_POSTGRESS -i instance1 -b DumpBasedBackupSet -s default

Sample Output:

Name            : default
Default         : Yes
Storage Policy  : SP
Description     : Subclient description

qlist subclient

Description

This command lists the names of all the subclients in a specified client, agent, and instance/backup set. Whenever more than one subclient is found, each subclient is listed in its own line on the command prompt. No message is displayed whenever subclients are not found.

In case of an error, an error code and description are displayed as: "subclient: Error errorcode: errordescription"

Usage

qlist subclient -c client -a dataagenttype -i instance -b backupset [-tf tokenfile] [-tk token] [-h]

Options

-c Client computer name
-a Agent type installed on client computer (see Argument Values - Agent Types)
-i Instance name, required for certain agents
-b Backup set name, required for certain agents
-tf Reads token from a file
-tk Token string
-h Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Example

List all the Subclients in the client client1, Agent Q_POSTGRESS and backup set DumpBasedBackupSet .

qlist subclient -c client1 -i instance1 -a Q_POSTGRESS -b DumpBasedBackupSet

The output for the qlist command is:

default
sc1

qdelete subclient

Description

This command deletes a given subclient.

Upon successful completion, the qdelete subclient command displays the message "Deleted subclient successfully" on the command prompt. In case of an error, an error code and description are displayed as: "subclient: Error errorcode: errordescription"

Usage

qdelete subclient -c client -a dataagenttype -i instance -b backupset -s subclient [-tf tokenfile] [-tk token] [-af ArgumentFilepath] [-h]

Options

-c Client computer name
-a Agent type installed on client computer (see Argument Values - Agent Types)
-i Name of the instance
-b Name of the backup set
-s Name of the subclient to be deleted
-af Reads arguments from a file
-tf Reads token from a file
-tk Token string
-h Displays help

Argument File

client Client computer name
dataagent Agent type installed on client computer (see Argument Values - Agent Types)
instance Instance name
backupset Backup set name
subclient Subclient name to be deleted

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Example

Delete a subclient with name sc1 under client client1 and Agent Q_POSTGRESS and backup set DumpBasedBackupSet.

qdelete subclient -c client1 -a Q_POSTGRESS -i instance1 -b DumpBasedBackupSet -s sc1

Deleting the Client (qdelete client)

Description

This command can be used to deconfigure and/or delete a client, along with its iDataAgents.

By default, the qdelete client command asks for confirmation before deleting the client. You can skip the confirmation prompt with the -y option.

Upon successful completion, qdelete client displays the message "Deleted the client successfully" on the command prompt. In case of an error, an error code and description are displayed as: "client: Error errorcode: errordescription

Usage

qdelete client [-cs <commserve_host_name>] -c <client> [-deconfigure] [-y] [-tf <tokenfile>] [-tk <token>] [-af <clientfile>] [-h]

Options

-cs CommServe host name
-c Client computer name
-deconfigure Deconfigures a client without deleting it
-y Delete without confirmation
-tf Reads token from a file
-tk Token string
-af Reads client name from a file
-h Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Examples

  • Delete a client with name client1.

    qdelete client -c client1
    This command deconfigures and deletes a client, do you want to continue (y/n)? [n]

  • Deconfigure, but do not delete, a client with name client1

    qdelete client -c client1 -deconfigure -y

  • Delete a set of clients specified in an argument file.

    qdelete client -af "E:\clients.txt"

    In this example, clients.txt is a text file containing a list of client names. Ensure that the file is in the following format:

    [client]
    Client01
    Client02
    ClientXX

You can mass-delete clients with or without their associated MediaAgents using the qdelete client command. You can include this command (along with the qdelete mediaagent command, if desired) in a script. Mass deletion of these items is useful if you want to remove them after a split of a CommCell. To mass-delete items where the CommCell is not split, be sure to run the script from the install location of the CommServe.

Deleting the Agent (qdelete dataagent)

Description

This command deconfigures and/or deletes a given iDataAgent.

By default, the qdelete dataagent command asks for confirmation before deletion. You can skip the confirmation prompt using the "-y" option.

Upon successful completion, qdelete dataagent displays the message "Deleted the iDataAgent successfully" on the command prompt. In case of an error, an error code and description are displayed as: "dataagent: Error errorcode: errordescription"

Usage

qdelete dataagent -c client -a iDataAgent [-deconfigure] [-y] [-tf tokenfile] [-tk token] [-h]

Options

-c Client computer name
-a iDataAgent to be deleted (see Argument Values - Agent Types)
-d Deconfigures the iDataAgent without deleting it
-y Delete without confirmation
-tf Reads token from a file
-tk Token string
-h Displays help

Diagnostics

Possible exit status values are:

0 - Successful completion.

1 - CLI usage failures, due to the use of an unsupported option or missing argument.

2 - Any other failure.

Examples

  • Delete an iDataAgent MyDataAgent under client client1.

    qdelete dataagent -c client1 -a MyDataAgent
    This command deconfigures and deletes an iDataAgent, do you want to configure (y/n)

  • Deconfigure an iDataAgent MyDataAgent under client client1 without any confirmation.

    qdelete client -c client1 -a MyDataAgent -deconfigure - y

Log Off from the CommServe

Once you have completed the command line operations, you can logout from the CommServe using the following command:

qlogout -cs commserve

For example, to log out from the CommServe 'Server1'.

qlogout -cs Server1