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
Creating an Instance
-
Download the create_instance_template.xml file and save it on the computer from where the command will be executed.
-
Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.
On a UNIX client:
qoperation execute -af create_instance_template.xml -appName 'MySQL' -clientName xxxxx -instanceName xxxxx -userGroupName xxxxx -BinaryDirectory xxxxx -LogDataDirectory xxxxx -configFile xxxxx -port xxxxx -SAUser/userName xxxxx -SAUser/password xxxxx -unixUser/userName xxxxx -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName xxxxx -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName xxxxx
Example:
qoperation execute -af create_instance_template.xml -appName 'MySQL' -clientName client1 -instanceName instance1 -BinaryDirectory /usr/bin -LogDataDirectory var/log/mysql -configFile etc/mysql/my.cnf -port /var/run/mysqld/mysqld.sock -SAUser/userName 'root' -SAUser/password 'mysql' -unixUser/userName 'root' -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName SP1 -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName SP1
Example to create an instance with XtraBackup option enabled:
qoperation execute -af create_instance_template.xml -appName 'MySQL' -clientName client1 -instanceName instance1 -BinaryDirectory /usr/bin -LogDataDirectory var/log/mysql -configFile etc/mysql/my.cnf -port /var/run/mysqld/mysqld.sock -SAUser/userName 'root' -SAUser/password 'mysql' -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName SP1 -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName SP1 -xtraBackupSettings/enableXtraBackup 'true' -xtraBackupSettings/xtraBackupBinPath '/usr/bin'
On a Windows client:
qoperation execute -af create_instance_template.xml -appName 'MySQL' -clientName xxxxx -instanceName xxxxx -userGroupName xxxxx -BinaryDirectory xxxxx -LogDataDirectory xxxxx -configFile xxxxx -port xxxxx -SAUser/userName xxxxx -SAUser/password xxxxx -NTUser/userName xxxxx -NTUser/password xxxxx -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName xxxxx -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName xxxxx
Example:
qoperation execute -af create_instance_template.xml -appName 'MySQL' -clientName client1 -instanceName instance1 -BinaryDirectory 'C:\Program Files\MySQL\MySQL Server 5.1\bin' -LogDataDirectory 'C:\Program Files\MySQL\MySQL Server 5.1' -configFile 'C:\Program Files\MySQL\MySQL Server 5.1\my.ini' -port 3306 -SAUser/userName root -SAUser/password mysql -NTUser/userName 'testwin\administrator' -NTUser/password 'password' -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName SP1 -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName SP1
Modifying an Instance
-
Download the modify_instance_template.xml file and save it on the computer from where the command will be executed.
-
Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.
qoperation execute -af modify_instance_template.xml -appName 'MySQL' -clientName xxxxx -instanceName xxxxx -userGroupName xxxxx -associatedUserGroupsOperationType xxxxx -BinaryDirectory xxxxx -LogDataDirectory xxxxx -ConfigFile xxxxx -port xxxxx -SAUser/userName xxxxx -SAUser/password xxxxx -enableAutoDiscovery xxxxx -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName xxxxx -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName xxxxx
The following examples show some common modification operations.
Specifying the Configuration File
qoperation execute -af modify_instance_template.xml -appName 'MySQL' -clientName client1 -instanceName instance1 -ConfigFile 'C:\Program Files\MySQL\MySQL Server 5.5\my.ini' -SAUser/userName 'user1' -SAUser/password 'pwd1'
Specifying the Binary and Log Data Directory
qoperation execute -af modify_instance_template.xml -appName 'MySQL' -clientName client1 -instanceName instance1 -BinaryDirectory 'C:\Program Files\MySQL\MySQL Server 5.5\bin' -LogDataDirectory 'C:\Program Files\MySQL\MySQL Server 5.5\data' -SAUser/userName 'user1' -SAUser/password 'pwd1'
Modifying Xtrabackup Bin Path
qoperation execute -af modify_instance_template.xml -appName 'MySQL' -clientName client1 -instanceName instance1 -BinaryDirectory /usr/bin -LogDataDirectory var/log/mysql -configFile etc/mysql/my.cnf -port /var/run/mysqld/mysqld.sock -SAUser/userName 'root' -SAUser/password 'mysql' -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName SP1 -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName SP1 -xtraBackupSettings/enableXtraBackup 'true' -xtraBackupSettings/xtraBackupBinPath '/xtrabackupbin/'
Changing the Instance Name
qoperation execute -af modify_instance_template.xml -appName 'MySQL' -clientName client1 -instanceName instance1 -newName instance2 -BinaryDirectory /usr/bin -LogDataDirectory var/log/mysql -configFile etc/mysql/my.cnf -port /var/run/mysqld/mysqld.sock -SAUser/userName 'root' -SAUser/password 'mysql' -enableAutoDiscovery Yes -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName SP1 -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName SP1
Enabling Proxy Backup Operation
-
Download the enable_proxy_instance_template.xml file and save it on the computer from where the command will be executed.
-
Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.
qoperation execute -af enable_proxy_instance_template.xml -appName 'MySQL' -clientName xxxxx -instanceName xxxxx -isProxyEnabled true -proxyInstance/clientName xxxxx -proxyInstance/instanceName xxxxx -runBackupOnProxy true -isUseSSL true
Example:
qoperation execute -af enable_proxy_instance_template.xml -appName 'MySQL' -clientName 'client1' -instanceName 'instance1' -isProxyEnabled true -proxyInstance/clientName 'client2' -proxyInstance/instanceName 'instance2' -runBackupOnProxy true -isUseSSL true
Getting Instance Properties
-
Download the get_instance_properties_template.xml file and save it on the computer from where the command will be executed.
-
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 'MySQL' -clientName xxxxx -instanceName xxxxx
Deleting an Instance
-
Download the delete_instance_template.xml file and save it on the computer from where the command will be executed.
-
Execute the following command from the <Software_Installation_Directory>/Base folder after substituting the parameters values.
qoperation execute -af delete_instance_template.xml -appName 'MySQL' -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 |
clientName |
Name of the client computer. |
appName |
Name of the application. In this case it would be 'MySQL'. |
instanceName |
Name of the MySQL instance. If you are specifying an instance other than the default instance, the name must be entered along with the client name, e.g. client1\instance1. |
userGroupName |
Name of the user group to be associated to the instance. This is the user group that you associate from the Security tab of the instance properties dialog box in the CommCell Console. |
associatedUserGroupsOperationType |
Specifies the operation that you want to perform on the user groups. Valid values are:
|
BinaryDirectory |
Path of the binary directory for the database instance. |
LogDataDirectory |
Path of the directory where the logs are stored for the database instance. |
ConfigFile |
Path of the configuration file for the database instance. |
port |
The port (on Windows) or socket file (on Unix) to open the communication between the MySQL server and its clients. |
enableAutoDiscovery |
Option to search in the MySQL instance for databases that are not configured in order to add them to the system. This discovery process runs on the entire instance prior a backup operation. Valid values are True/False. |
logStoragePolicy/storagePolicyName |
Name of the storage policy used to back up this instance. |
SAUser/userName |
Name of the MySQL database administrator who has permissions to perform jobs. |
SAUser/password |
Password for the MySQL database administrator. |
newName |
New name of the MySQL instance. |
The following example show how to add a parameter for a command:
Specifying the Configuration File |
qoperation execute -af modify_instance_template.xml -appName 'MySQL' -clientName client1 -instanceName instance1 -ConfigFile 'C:\Program Files\MySQL\MySQL Server 5.5\my.ini' -SAUser/userName 'user1' -SAUser/password 'pwd1' |