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] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[xxxxx] -LogDataDirectory $[xxxxx] -configFile $[xxxxx] -port $[xxxxx] -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName $[xxxxx] -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName $[xxxxx]
Example:
qoperation execute -af create_instance_template.xml -appName '$[MySQL]' -clientName $[client1] -instanceName $[instance1] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[/usr/bin] -LogDataDirectory $[var/log/mysql] -configFile $[etc/mysql/my.cnf] -port $[/var/run/mysqld/mysqld.sock] -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] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[/usr/bin] -LogDataDirectory $[var/log/mysql] -configFile $[etc/mysql/my.cnf] -port $[/var/run/mysqld/mysqld.sock] -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName $[SP1] -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName $[SP1] -xtraBackupSettings/enableXtraBackup $[true] -xtraBackupSettings/xtraBackupBinPath $[/usr/bin]
Example to create MySQL instance with MySQL Enterprise backup option enabled:
qoperation execute -af create_instance_template.xml -appName '$[MySQL]' -clientName $[client1] -instanceName $[instance1] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[/usr/bin] -LogDataDirectory $[var/log/mysql] -configFile $[etc/mysql/my.cnf] -port $[/var/run/mysqld/mysqld.sock] -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName $[SP1] -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName $[SP1] -mebSettings/enableMEB $[true] -mebSettings/mebBinPath $[/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 FilesMySQLMySQL Server 5.1bin]' -LogDataDirectory '$[C:Program FilesMySQLMySQL Server 5.1]' -configFile '$[C:Program FilesMySQLMySQL Server 5.1my.ini]' -port $[3306] -SAUser/userName $[root] -SAUser/password $[mysql] -NTUser/userName '$[testwinadministrator]' -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] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[xxxxx] -LogDataDirectory $[xxxxx] -ConfigFile $[xxxxx] -port $[xxxxx] -enableAutoDiscovery $[xxxxx] -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName $[xxxxx] -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName $[xxxxx]
The following examples show some common modification operations.
Modifying the Credential
qoperation execute -af modify_instance_template.xml -appName 'MySQL' -clientName 'client1' -instanceName 'instance1' -credentialEntity/credentialName $[xxxxx] -BinaryDirectory '/usr/bin' -LogDataDirectory '/var/lib/mysql' -ConfigFile '$[C:Program FilesMySQLMySQL Server 5.5my.ini]' -port '/var/lib/mysql/mysql.sock' -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName 'storage_policy_name' -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName 'storage_policy_name'
Specifying the Configuration File
qoperation execute -af modify_instance_template.xml -appName '$[MySQL]' -clientName $[client1] -instanceName $[instance1] -ConfigFile '$[C:Program FilesMySQLMySQL Server 5.5my.ini]'
Specifying the Binary and Log Data Directory
qoperation execute -af modify_instance_template.xml -appName '$[MySQL]' -clientName $[client1] -instanceName $[instance1] -BinaryDirectory '$[C:Program FilesMySQLMySQL Server 5.5bin]' -LogDataDirectory '$[C:Program FilesMySQLMySQL Server 5.5data]' -SAUser/userName '$[user1]' -SAUser/password '$[pwd1]'
Modifying Xtrabackup Bin Path
qoperation execute -af modify_instance_template.xml -appName '$[MySQL]' -clientName $[client1] -instanceName $[instance1] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[/usr/bin] -LogDataDirectory $[var/log/mysql] -configFile $[etc/mysql/my.cnf] -port $[/var/run/mysqld/mysqld.sock] -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName SP1 -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName $[SP1] -xtraBackupSettings/enableXtraBackup '$[true]' -xtraBackupSettings/xtraBackupBinPath '$[/xtrabackupbin/]'
Modifying Mysql Enterprise Backup binary path
qoperation execute -af modify_instance_template.xml -appName '$[MySQL]' -clientName $[client1] -instanceName $[instance1] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[/usr/bin] -LogDataDirectory $[var/log/mysql] -configFile $[etc/mysql/my.cnf] -port $[/var/run/mysqld/mysqld.sock] -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName SP1 -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName $[SP1] -mebSettings/enableMEB $[true] -mebSettings/mebBinPath $[/mysqlbackupbin]
Disabling Mysql Enterprise Backup
qoperation execute -af modify_instance_template.xml -appName '$[MySQL]' -clientName $[client1] -instanceName $[instance1] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[/usr/bin] -LogDataDirectory $[var/log/mysql] -configFile $[etc/mysql/my.cnf] -port $[/var/run/mysqld/mysqld.sock] -mysqlStorageDevice/logBackupStoragePolicy/storagePolicyName SP1 -mysqlStorageDevice/commandLineStoragePolicy/storagePolicyName $[SP1] -mebSettings/enableMEB $[false]
Changing the Instance Name
qoperation execute -af modify_instance_template.xml -appName '$[MySQL]' -clientName $[client1] -instanceName $[instance1] -newName $[instance2] -credentialEntity/credentialName $[xxxxx] -BinaryDirectory $[/usr/bin] -LogDataDirectory $[var/log/mysql] -configFile $[etc/mysql/my.cnf] -port $[/var/run/mysqld/mysqld.sock] -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. |
|
CredentialName |
Name of the client credential. |
|
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. |
|
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 8.0\my.ini' -credentialEntity/credentialName 'xxxxx' |