Creating 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 Action 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 RBAC access control.

    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.

    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.

    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. For example, if an Action runs in serial mode and fails on host 1, it continues to run on host 2.

    Note: This option applies only for standalone actions running in serial on multiple hosts. In parallel mode, this option has no effect.

    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.

    Note

    SQL Actions cannot be set for use as pre-provisioning scripts.

    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.

    Note

    SQL Actions cannot be set for use as post-provisioning scripts.

    Appears in scopeType 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

    (Not displayed for Actions with a scope of Node) Select this field to specify this Action for clustered databases. 

    Application Type

    (Not displayed for Actions with a scope of Node) 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

    (Not displayed for Actions with a scope of Node) 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

    (Not displayed for Actions with a scope of Node) 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

    (Not displayed for Actions with a scope of Node) 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

    (Not displayed for Actions with a scope of Node) 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.

    Note

    Action Restrictions by operating system are meant to provide maximum flexibility. Adding more OS restrictions does not restrict the action to fewer operating systems, it adds to the list of operating systems that the action can target.
    For Operating System Alias, Operating System Long Name, and Operating System Type, you can specify a value for all the fields or for a single field.
    For example,

    If you want an action that runs only on all Linux targets and AIX 5.3 and 6.1 targets, specify the following OS restrictions:
    • OS type = AIX 5.3
    • OS type = AIX 6.1
    • OS alias = Linux Operating System

    This action will run on the Linux nodes that match the OS alias restriction, and on AIX 5.3 or 6.1 nodes. If you want AIX 5.3 and 6.1 targets, specify only the OS type restrictions. If you want only Linux targets, specify just the OS alias restriction.

  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.

Creating a Remediation Action

Remediation Actions are BDA Actions that have been associated with a specific standard and remediate one or more checks implemented by that standard. When you run a Remediation Action through the BDA GUI, the candidates listed will be restricted to those that have had that particular standard run against them and are currently non-compliant for the checks listed in the Remediation Action.

To create a Remediation Action in BDA, follow the steps to create an Action. Make sure that the scope of the Action is the same as the scope of the standard that it will be remediate. For example, if you write an Action to remediate problems in an Oracle Database-scoped standard, the Action must also be Oracle Database-scoped. Then, in the Remediation section in the Create Action page, select Is Remediation Action.

This enables a menu consisting of all standards that have the same scope as the Action you create. Select the standard that this Action will be associated with (and will remediate failed checks for) and click Add Check. Next, enter the check ID of the check this Action will remediate. If the action will remediate more than one check, click Add Check multiple times and enter one check ID per text field.

Continue with creating the action as you would any other action in BDA.

When the Remediation Action is run, you are presented with a list of candidates that are non-compliant for the checks listed on the Remediation page. However, the Remediation Action is passed no information during the execution of the Action about what checks have failed and what checks have succeeded. The Remediation Action must re-perform whatever checks were performed by the standard and determine what needs to be remediated.

Furthermore, when a Remediation Action has completed running, there is no mechanism for reporting the change in compliance back to the BDA Manager. Once a Remediation Action is complete, you should re-run the compliance standard again against the targets and collect new compliance data that reflects the remediated checks.

Was this page helpful? Yes No Submitting... Thank you

Comments