Page tree

This topic describes how to create an Action.

To create an Action

Note

To run SQL Actions, runme.sql is required. Before executing the Action, BMC Database Automation automatically replaces GA, GAC and GAD variables that are specified in runme.sql with the value that has been set in the environment by using braces ({}); for example, {GA_DB_NAME} and {GA_DB_ORACLE_HOME}. This substitution helps provide easy access to variables that are set in the environment of the SQL script. For more information about environment variables for Actions, see Actions environment variables.

  1. From the Management Console, select Actions > Action Repository.
  2. In the Actions Repository page, click Create New Action.
  3. In the General page, populate the following fields, and click Next.

    Field

    Description

    Name

    Type a name for this Action.

    Type

    Select the type for this Action (Script Action or SQL Action).

    Scope

    Select the scope for this Action.

    Description

    (Optional) Type a description of this Action.

    Container

    Assign the Action to a domain.

    Important: The domain selected as the Container determines which users can modify the Action. Users with Action run, edit, delete, or export capabilities for the Container domain can perform all those tasks against the Action, whereas users with capabilities in the Available To domains can only use their Action run capability for this Action.

    Available To

    (Optional) Select the domains to which this Action is available. Only users with permission to perform Action Roles and Capabilities in these domains are able to run this Action. The selected domains appear in the Selected Available Domains field.

    Selected Available DomainsView the available domains based on what you selected in the Available To field.
    Restricted ActionSelect the check box to assign this Action as restricted. Only users with Run a Restricted Action capability can run the restricted Action. When selecting this option, the Restricted Action property is displayed in the Action Information section of the Action View page and set to Yes.
  4. In the Action Execution page, populate the following fields, and click Next.

    Field

    Description

    Action Run As

    (For script actions only): Enter the permission level at which the Action runs.

    • Root: Action runs at the Root privilege level
    • Install Owner:
      Oracle: Action runs as the Oracle installation user of the database (or the installation user of CRS for activities, such as Create Cluster/Add Node in versions 11.2 and earlier).
      Sybase: Action runs as the installation user of the Sybase Dataserver or Replication Server.
      DB2: Action runs as the user that owns the DB2 instance.
      SQL Server: This option is not available for SQL Server-scoped script actions (there is no instance owner for SQL Server instances).

      This field is available for the following scopes for script Actions: Oracle Home, Oracle Database, Oracle Database Instance, Sybase Dataserver, Sybase Dataserver Instance, Repserver, and Repserver Instance.

      Note: You need the appropriate capability to change this setting. For more information about capabilities, see User permissions.

    Execution Sequence

    Select how multiple Actions are run.

    • Parallel: Runs the Action in parallel across nodes that contain the selected candidates, with activities on each node running in serial. Candidates that share a dependency (that is, are on the same host) would revert to running in serial.
    • Serial: Runs the Action to completion on one candidate at a time.

      Note: Select the Make Field Read-Only When Executing Action option to make the value for this field read-only when this Action is run.

     

    Rescan Nodes On Completion

    (Optional) Select this field to scan the nodes after the Action has completed running.

    Note: Select the Make Field Read-Only When Executing Action option to make the value for this check box read-only when this Action is run.

    Continue On Error

    (Optional) Select this field to allow serial activities to continue to run in the event of a failure.

    Note: Select the Make Field Read-Only When Executing Action option to make the value for this check box read-only when this Action is run.

  5. In the Availability page, populate the following fields, and click Next.

    Field

    Description

    Available as Pre-Provisioning Script

    Select this field to make this Action available as a pre-provisioning script file in the Custom Scripts Configuration page for provisioning activities. The scope of the Action determines availability. See Actions scope and provisioning associations.

    Available as Post-Provisioning Script

    Select this field to make this Action available as a post-provisioning script file and final script file (when applicable) in the Custom Scripts Configuration page for provisioning activities. The scope of the Action determines availability. See Actions scope and provisioning associations.

    Appears in scope_type Menu

    Select this field to add this Action to the menu for the Grid view associated with the scope selected, by using the information specified in the Menu Name and Menu Option Name fields. For example, if the scope selected for an Action is Oracle Database Instance, the information appears in the menus for Oracle database instances in the Grid view.

    Menu Name

    Specify the Action category where this Action appears. You can select an existing category, or create a new one.

    Menu Option Name

    Specify the name of this Action as it appears in the specified Action category.

  6. In the Remediation page, populate the following fields, and click Next.

     

    Field

    Description

    Is Remediation Action

    Select the check box to specify that this is a Remediation Action. When this option is selected the remaining fields in the page display.

    Standards

    Select the standard from the menu.

    Remediation Checks

    Displays the name of the checks to remediate. If there are no remediation checks, click Add Check and type the name of a check for the selected standard. Click the Remove icon to remove a check.

  7. (For SQL Actions only) In the Credentials page, select the Credentials Options option button corresponding to one of the following options:

    Field

    Description

    (For DB2): Run as Instance User
    (For Oracle): Run as SYSDBA
    (For Mssql): Run as LSA user
    (For Sybase): Run as SA user

    Runs the Action using the administrator credentials for the selected database instance.

    Enter Credentials Now

    Displays the Credentials section, where you specify the user name and password.

    Require Credentials at Run Time

    Requires that you specify the user name and password in the Credentials page when you run the Action.

  8. In the Application Schema page, populate the following fields, and click Next.

    Field

    Description

    Is Application Schema Action

    Select this field if there is an Action associated to this application schema. Selecting the check box enables the remaining fields on the page.

    Container

    Select the container domain for the application schema for which this Action is being associated.

    Application Schema

    Select the application schema from the selected container.

    Application Schema Relationship

    Select the relationship of the application schema:

    • This Action Deploys Application Schema: Takes databases that are not already associated with the application schema and deploys the application schema on them.
    • This Action Applies to: Updates databases that are already associated with the application schema.
      You do not need to specify a role when creating the Action, because you will be prompted to supply the role when the Action is run, thereby allowing the same Action to be used for any role.
  9. In the Custom Fields page, specify custom fields for this Action and click Next.
    1. Click Add.
    2. Enter the name of the custom field in the Custom Fields Name field. The name used here must match the name used in the template that you load in the Actions Files page.
    3. If this custom field should be a required field, select the Required check box.
    4. Click Add to add the field name to the list.
    5. Repeat these steps for each custom field to be added to this Action.
  10. In the Restrictions page, populate the following fields, and click Next.

    Field

    Description

    Is Clustered

    Select this field to specify this Action for clustered databases. This field is not displayed for Actions with a scope of Node.

    Application Type

    Specify the application type for this Action. This field is displayed only for Actions with a scope of Application or Application Instance.

    Application Major Version

    Click Add to specify a restriction to a major version of an application in the field.

    Example formats are:

    • SQL Server: 9.0, 10.0, 10.5, 11.0
    • Sybase: 12.5, 15.0, 15.5, 15.7
    • DB2: 9.5, 9.7, 10.1
    • Oracle: 10.1, 11.1

    Application Minor Version

    Click Add to specify a restriction to a minor version of an application in the field.

    Example formats are:

    • SQL Server: 10.0.2500, 10.50.5000
    • Sybase: 12.5.4, 15.0.3
    • DB2: 9.5.0.2, 9.7.0.3a
    • Oracle: 11.1.2.2

    scope_type Major Version

    Specify the major version of the scope type for this Action. Click Add to open the field for entry, and then enter the version number and click Add to add it to the major version list. This field does not appear for Actions with a scope of Node.

    scope_type Minor Version

    Specify the minor version of the scope type for this Action. Click Add to open the field for entry, and then enter the version number and click Add to add it to the minor version list. This field does not appear for Actions with a scope of Node.

    Operating System Alias

    Specify the OS aliases for this Action. Click show to open the field for selection, and then select the OS aliases and click to move them to the Selected list box.

    Operating System Architecture

    Specify the OS architecture for this Action. Click show to open the field for selection, and then select the OS architecture and click to move it to the Selected list box.

    Operating System Long Name

    Specify the OS long name for this Action. Click Add to open the field for entry, and then enter the version number and click Add to add it to the minor version list.

    Operating System Type

    Specify the OS types for this Action. Click show to open the field for selection, and then select the OS types and click to move them to the Selected list box.

  11. In the Action Files page, populate the following fields, and click Next.

    Note

    BMC Database Automation supports the uploading of zipped content files. The maximum file size supported for a zipped content file is 2 GB.

    Field

    Description

    Content Files

    Specify the runme or runme.bat file required for every Action. Click Upload File to locate and upload the runme or runme.bat file and any additional files for this Action.

    Zipped Content Files

    Upload multiple content files.

    To locate and upload a .zip file containing multiple files such as the runme and Action content files, including custom verification checks, click Upload Zip File to locate and upload the .zip file.

    If you are uploading a custom verification checks file, see Creating custom verification check files.

    Template Files

    Upload template files. To locate and upload one or more Action XML template files for use with this Action, click Upload Template File.

    To open a pre-populated sample XML template that you can name and edit, click Create New Template.

  12. In the Summary page, review the provisioning information.
    To make changes, do the following:
    1. Click Go to to return to the provisioning step that you want to edit.
    2. Make your changes.
    3. Click Save and Review to return to the Summary page.
  13. Click Create Action to finish creating the Action.

Actions scope and provisioning associations

BMC Database Automation Actions can be used as pre-provisioning and post-provisioning scripts during provisioning operations. When the options for Available as Pre-Provisioning Script and Available as Post-Provisioning Script are selected on the Actions Configuration page, the Actions scope determines the relevant scripts to display on the Custom Scripts Configuration page during provisioning.

    Actions Scope
Database type Wizard   Oracle SQL Server Sybase
    Node Home DB DB instance Member instance DB Dataserver/ Dataserver instance Repserver/ Repserver instance
Oracle Create cluster X X            
  Add node X X            
  Remove node X X            
  Remove cluster X X            
  Create Oracle database X X X X        
  Add instance X X X X        
  Upgrade Oracle database X X X X        
  Remove instance X X X X        
  Remove Oracle database X X X X        
  Create Oracle Home X X            
SQL Server Create MSSQL instance X       X      
  Add node to instance X       X      
  Remove node from instance X       X      
  Remove MSSQL instance X       X      
  Create MSSQL database X       X X    
  Remove MSSQL database X       X X    
Sybase Create Dataserver X           X  
  Remove Dataserver X           X  
  Create Replication Server X             X
  Remove Replication Server X             X