Performing provisioning operations using bdacli
Command line utilities support using templates to perform provisioning operations on all the databases supported by BMC Database Automation (BDA). The bdacli utility uses command-based syntax that specifies what operations will be performed on the database by referencing a template for those operations.
Before you begin
Ensure that you have downloaded the command line utilities and have configured your environment to use them. For more information, see Setting-up-the-CLI-environment.
Manager address and user credentials
To successfully initiate a job, provide a manager address and login/password using environment variables or command line parameters. You will most likely use environment variables because of the likelihood that you will use one manager with its own BMC Database Automation credentials. Note, however, that command line parameters take a precedence over environment variables.
The following environment variables are used:
- GA_MANAGER (manager address)
- GA_USERNAME (user)
- GA_PASSWORD (password)
Alternatively, the following command line parameters can be used:
- --manager
- --username
- --password
Using the utility
To use the tool, type the following command:
You can use the DB type as a shortcut to replace the type option. For example:
bdacli_oracle.pl --remove-database
bdacli_sybase.pl --apply-patch
bdacli_db2.pl --add-instance
The following table describes the command line arguments that are used in the syntax for the bdacli tool.
Working with templates
You can specify a template in one of two ways:
- Template FQN (for example, /oracle_instance_provision_template)
- Template ID
Overriding template parameters
To override existing parameters in a template, set the --params parameter in the bdacli utility. For example, the following existing template:
ora_home_location=/app/oracle
can be overridden using the utility, as follows:
# bdacli_oracle.pl --create-database --host-name=rh6-si-384.domain.com --database-name=ONE --version=12.1.0.1 --params="ora_home_location=/opt/oracle" /oracle_instance_provision_template
Setting wizard parameters
Wizard parameters for a template can be configured using the command line or an XML file.
Setting wizard parameters using the command line
Using the command line to set parameters is especially effective for operations that can be easily expressed in a wizard. For example the following syntax is used for Oracle single instance provisioning:
Setting wizard parameters in an .xml file
When you have several parameters you want to set, you can type them into an XML file, as shown in the following example:
You then reference the saved file in your command line syntax, as shown in the following example:
Using custom fields and parameters to set and substitute values
You can define any number of custom fields, set field values as those custom fields and then, using the --params argument, override those values.
For example, set this custom field in your template:
<field>
<name>ASM_DISK_GROUP_NAME</name>
<value/>
<required>true</required>
<editable>true</editable>
<hidden>false</hidden>
</field>
Then, use it as a replacement custom field. For example:
Name: Disk Group Name
Description: The name of the diskgroup.
Required: This is a required field if specifying diskgroups.
-->
<name>{ASM_DISK_GROUP_NAME}</name>
Next, specify a new value using the params option. For example:
Provisioning operations
To locate a specific operation to perform using the bdacli command line tool, perform any of the following actions:
- Select an option from the Type list to filter the table by database type.
- Select an option from the Operation list to filter the table by a specific provisioning operation that you want to perform for the selected database type, such as Create Database.
- Type a character string in the Description boxes to filter the list of operations (for example, typing cre in the Description field displays all operations with Create in the description.
- Click any column heading to sort this table or change sort direction.
List operations
In addition to enabling provisioning operations, the bdacli utility provides the ability to list the available patches for a specific database type, as shown in the following example: