Skip Headers
Oracle® Enterprise Manager Administrator's Guide for Software and Server Provisioning and Patching
11g Release 1 (11.1.0.1.0)

E16599-06
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

31 Customizing Deployment Procedures

The Deployment Procedures offered by Enterprise Manager Grid Control are default procedures that have been created considering all the best practices in the industry. The steps embedded within a Deployment Procedure ensure that they meet all your provisioning and patching requirements. You can, of course, use them with the default settings to provision or patch your targets in the environment, however, you also have the choice of customizing them to include additional custom steps, disable unwanted steps, and use authentication tools to run some steps as another user.

By customizing Deployment Procedures, you can also implement different error handling methods. For example, in a patching operation where multiple hosts are patched in parallel, it may be wise to skip the host on which a failure occurs. However, failure on a device creation could render the remaining provisioning operation ineffective. Therefore, it may be necessary to abort the entire procedure for failure of such a step.

This chapter helps you understand how you can customize Deployment Procedures to make them suit your needs. In particular, this chapter covers the following:

Understanding Customization Types

The following describes the types of customization you can perform with Deployment Procedures:

Type 1 Type 2
Editing Default Deployment Procedures

You can edit an existing, default Deployment Procedure that is offered by Enterprise Manager Grid Control.

You can perform the following tasks:

  • Add your own phases and steps

  • Enable and disable phases and steps

  • Delete phases and steps

  • Change privilege levels

  • Change error handling modes

  • Enable e-mail notifications

Creating Custom Deployment Procedures

You can create your own custom Deployment Procedure with new steps, phases, privilege levels, and so on. However, note that you can create custom Deployment Procedures only using Patching Deployment Procedures.

You can perform the following tasks:

  • Delete all default phases and steps

  • Add your own phases and steps

  • Enable and disable phases and steps

  • Change privilege levels

  • Change error handling modes

  • Enable e-mail notifications


The following shows the different sections that need to be edited while customizing a Deployment Procedure to add or delete steps, enable or disable steps, enable e-mail notifications, and enable other privilege-level settings.

Customization Overview

Understanding the Limitations

Before you start customizing the Deployment Procedures, keep in mind the following points:

Creating Copy of Deployment Procedure

The first step towards customizing a Deployment Procedure is to create a copy of the default Deployment Procedure that is offered by Enterprise Manager Grid Control. Note that only a copy can be edited and customized with your changes; the default Deployment Procedures must always and will always remain unchanged.

To create a copy of a default Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, edit the procedure to customize it according to your needs, and click Save.

Adding Phases or Steps

You can add additional phases or steps to a Deployment Procedure to run additional custom scripts, host commands, or jobs. For more information about phases and steps, see Understanding Phases and Steps.

This section explains how you can add different types of phases or steps to a Deployment Procedure. In particular, it covers the following:

Adding Rolling or Parallel Phase

To add a rolling phase to a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select the phase before or after which you want to add a new phase, and click Insert.

  5. In the Create wizard, do the following:

    1. On the Create page, specify general information about the phase as described in Table 31-1.

    2. On the Select Target List page, select a target list to indicate the type of targets on which the new phase should run.

    3. On the Review page, review the information you have provided for creating a new phase, and click Finish.

Table 31-1 Field Description - Adding Rolling Phase

Field Name Description

Select

Select Phase.

Name

Specify a name for the custom phase.

Description

Provide a description for the custom phase.

Condition

Leave this field blank.

Insert Location

If you want to insert the custom phase after the phase or step you selected, then select After <phase or step name>. Otherwise, select Before <phase or step>.

Type

If you are adding a rolling phase, then select Rolling. If you are adding a parallel phase, then select Parallel.

Error Handling

Select the error handling mode you want to set for the custom phase. To understand these error handling modes, see Changing Error Handling Modes.


Adding Job Step

To add a job step to a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select the step before or after which you want to add a new step, and click Insert.

  5. In the Create wizard, do the following:

    1. On the Create page, specify general information about the step as described in Table 31-2.

    2. On the Select Type page, select a job type that best describes the task that you want the step to perform. For example, if you want to job to transfer files across the network, then select File Transfer.

    3. On the Map Properties page, specify values for the parameters that are required by the selected job type.

    4. On the Review page, review the information you have provided for creating a new step, and click Finish.

Adding Directive Step

To add a directive step to a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select the step before or after which you want to add a new step, and click Insert.

  5. In the Create wizard, do the following:

    1. On the Create page, specify general information about the step as described in Table 31-2.

    2. On the Select Directive page, select a directive from the Software Library that you want to run on the targets.

    3. On the Map Properties page, specify values for the properties associated with the selected directive.

    4. On the Review page, review the information you have provided for creating a new step, and click Finish.

Adding Generic Component Step

To add a generic component step to a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select the step before or after which you want to add a new step, and click Insert.

  5. In the Create wizard, do the following:

    1. On the Create page, specify general information about the step as described in Table 31-2.

    2. On the Select Component page, select a component from the Software Library that you want to stage on the targets.

    3. On the Select Directive page, select a directive from the Software Library that you want to run on the targets.

    4. On the Map Properties page, specify values for the properties associated with the selected component and directive.

    5. On the Review page, review the information you have provided for creating a new step, and click Finish.

Adding Registered Component Step

To add a registered component step to a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select the step before or after which you want to add a new step, and click Insert.

  5. In the Create wizard, do the following:

    1. On the Create page, specify general information about the step as described in Table 31-2.

    2. On the Select Type page, select a component type.

      The list is a subset of the component types displayed on the Components page in the Provisioning tab. Each type in the list has a specific job associated with it. These jobs stage and install the components.

    3. On the Select Component page, select a component from the Software Library that you want to stage on the targets.

    4. On the Map Properties page, specify values for the parameters that are required by the job associated with the selected component.

    5. On the Review page, review the information you have provided for creating a new step, and click Finish.

Adding Host Command Step

To add a host command step to a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select the step before or after which you want to add a new step, and click Insert.

  5. In the Create wizard, do the following:

    1. On the Create page, specify general information about the step as described in Table 31-2.

    2. On the Enter Command page, specify the command or script, which you want to run on the target, and the privilege to run it.

      To run the host command as a script, select Script from the Command Type list. Specify the shell that can interpret the script. The script is passed as standard input to the specified interpreter.

      To run the host command as a command line, select Single Operation from the Command Type list. Specify the text you want to execute used as a command line. No assumptions are made about the shell to interpret this command line. The first entry in the command line is assumed to be the process to spawn and the rest of the command line as passed as arguments to this process. Therefore, a command line of ls -a /tmp spawns a process of "ls" (from the current path; also depends on the Oracle Management Agent) and passes "-a" as the first argument and then "/tmp" as the second argument to this process.

      Note: The command line mode assumes that the first part of the command line is the process to be spawned. Therefore, shell internals and the commands that rely on the PATH environment variable for resolution are not recognized. If any such commands need to be used, then you need to prepend the shell that interprets the command line.

      For example, the command cd /tmp && rm -rf x expands to "cd" as a process and then "/tmp, &&, rm, -rf, x" as arguments. To fix this, change the command line to /bin/csh -c "cd /tmp && rm -rf x".

      Another example, the command export PATH=/opt:${PATH}; myopt -install expands to "export" as a process and then "PATH=/opt:${PATH};, myopt, -install" as arguments. To fix this, use /bin/sh -c "export PATH=/opt:${PATH}; myopt -install".

    3. On the Map Properties page, specify values for the parameters that are required by the job associated with the selected component.c

    4. On the Review page, review the information you have provided for creating a new step, and click Finish.

Adding Manual Step

To add a manual step to a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select the step before or after which you want to add a new step, and click Insert.

  5. In the Create wizard, do the following:

    1. On the Create page, specify general information about the step as described in Table 31-2.

    2. On the Enter Instructions page, provide a message to inform the operator about a manual step. For example, if want to instruct the operator to log in to a system and update the kernel parameter, then specify the following:

      You have been logged out of the system. Log in and update the Kernel parameters. 
      
    3. On the Review page, review the information you have provided for creating a new step, and click Finish.

Table 31-2 Field Description - Adding Steps

Field Name Description

Select

Select Step.

Name

Specify a name for the custom step.

Description

Provide a description for the custom step.

Condition

Leave this field blank.

Insert Location

If you want to insert the custom step after the step you selected, then select After <step name>. Otherwise, select Before <step>.

Type

  • For a job step, select Job.

  • For a directive step, select Library: Directive.

  • For a generic component, select Library: Generic Component.

  • For a registered component, select Library: Registered Component.

  • For a manual step, select Manual.

  • For a host command step, select Host Command.

Error Handling

Select the error handling mode you want to set for the custom step. To understand these error handling modes, see Changing Error Handling Modes.


Deleting Phases or Steps

You can delete the phases or steps that you do not want in a Deployment Procedure. For more information about phases and steps, see Understanding Phases and Steps.

To delete phases or steps in a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select the step or phase you want to delete, and click Delete.

    Oracle recommends that you disable the steps or phases instead of deleting them because steps or phases once deleted cannot be retrieved, but steps or phases disabled can always be enabled later. For information about enabling and disabling steps or phases, see Enabling or Disabling Phases or Steps.

Enabling or Disabling Phases or Steps

If you do not want to have some phases or steps in a Deployment Procedure, you can always disable them instead of deleting them. This is a preferred option because phases or steps once deleted cannot be retrieved, but phases or steps disabled can always be enabled later. For more information about phases and steps, see Understanding Phases and Steps.

To enable or disable phases or steps in a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, do the following:

    1. To disable a phase or step, select the phase or step you want to disable, and click Disable.

    2. To enable a phase or step, select the phase or step you want to enable, and click Enable.

The following is an example that illustrates how you customize the Oracle Database Provisioning Deployment Procedure to enable the Prepare Create Directory step:

Example of Enabling Steps

Customizing Steps to Run as Another User

All the Deployment Procedures offered by Enterprise Manager Grid Control require administrator privileges to run. While most steps within a Deployment Procedure can be run as a normal user, there are some steps that require special permissions and privileges, and unless you provide the administrator's credentials, you cannot proceed with the deployment. For more information about steps, see Understanding Phases and Steps.

Under such circumstances, you can do one of the following. Although the former option is recommended, you are always free to use the latter option to suit your needs.

This section how you can customize the steps within a Deployment Procedure to run them as another user. In particular, this section covers:

Using Privilege Delegation

While SUDO and PowerBroker are third-party utilities supported in Enterprise Manager Grid Control, Privilege Delegation is proprietary to Oracle. Privilege Delegation is a framework that allows you to use either SUDO or PowerBroker to perform an activity with the privileges of another user.

Privilege Delegation can use either SUDO or PowerBroker, but not both, and the settings are only for a single host. Therefore, if a host is set up with pbrun, then it will use only pbrun.

Caution:

The SUDO and PAM options are displayed in the Run Privilege list, which is available while customizing a Deployment Procedure. However, the options are displayed only for legacy reasons, and they will soon be deprecated. Consequently, you must use only Privilege Delegation.

Note:

The certified SUDO versions are 1.6.7 to 1.6.9. The certified PBRUN versions are 4.0.8 and 5.x. Higher versions of these utilities may continue to work unless some fundamental changes have been introduced to their behavior.

Privilege Delegation offers the following advantages:

  • You have the flexibility to use either SUDO or PowerBroker within the same framework.

  • Using the framework, you can now run PowerBroker in a passwordless or password-protected mode.

  • You can create a template with these Privilege Delegation settings and reuse it for multiple hosts. This not only allows you to standardize Privilege Delegation setting across your enterprise, but also facilitates the process of configuring Privilege Delegation Settings. It simplifies the Privilege Delegation setting management as well.

  • You can use the Privilege Delegation settings not only for deployment procedures, but also for jobs in Enterprise Manager Grid Control.

  • Privilege Delegation can read passwords from both STDIN and TTY.

Updating SUDOERS File with a List of Commands

If you want to use SUDO authentication utility, then before editing a Deployment Procedure, update the /etc/sudoers file to allow a normal user to switch to another user who has the privileges to run the Deployment Procedure. Also, if you want to restrict the normal user to have SUDO access only to certain commands, then specify a list of those commands for which SUDO access is required.

The following provides a list of commands for which SUDO access is required for different Deployment Procedures:

Table 31-3 Updating SUDOERS File with a List of Commands

Deployment Procedure Name Commands Requiring SUDO Access

All Deployment Procedures

The following are the minimum additions required to the /etc/sudoers file to run any job or Deployment Procedure:

$<ORACLE_HOME>/bin/nmosudo *

$<ORACLE_HOME>/perl/bin/perl

Here, <ORACLE_HOME> refers to the fully qualified path to the Oracle home of the Management Agent.

  • Oracle Clusterware / RAC Provisioning For UNIX

  • Oracle Clusterware / RAC Provisioning For Windows

  • One Click Extend Cluster Database

  • Delete/Scale down Oracle Real Application Clusters

  • Oracle Grid Infrastructure Provisioning for Standalone Servers

  • Oracle Grid Infrastructure / RAC Provisioning

/bin/sh, $ENV{EMDROOT}/perl/bin/perl, $ENV{EMDROOT}/bin/nmupm, $ENV{EMDROOT}/bin/nmhs, /bin/pwd, /usr/bin/tee, /bin/echo, /bin/cut,/sbin/ifconfig, /usr/bin/tr, /bin/awk,/bin/rpm, /bin/grep,/bin/sed, /sbin/sysctl, /usr/bin/free, /usr/sbin/useradd, /bin/cp,/sbin/service, /usr/bin/head, /usr/bin/tail, /bin/chmod, /bin/chown, /sbin/ifconfig, /usr/sbin/usermod, /sbin/depmod, /bin/uname, /bin/ln, /bin/umount, /bin/mount, /bin/mkdir, /bin/ls, /bin/rm, /bin/basename, /bin/netstat, /bin/df, /bin/hostname, /bin/mv

In addition, add the following line:

env_keep +="PERL5LIB"


Creating Privilege Delegation Templates

If you want to use Privilege Delegation authentication utility, then before editing a Deployment Procedure, create a Privilege Delegation template with the required settings for a host. To do so, follow these steps:

  1. In Grid Control, from the top-right corner, click Setup.

  2. On the Overview of Setup page, from the vertical menu, click Manage Privilege Delegation Settings.

  3. On the Manage Privilege Delegation Settings page, from the Related Links section, click Manage Privilege Delegation Settings Template.

  4. On the Manage Privilege Delegation Settings Templates page, from the Create list, select a privilege delegation type, either Sudo or PowerBroker, and click Go.

  5. On the Create '<delegation type>' Setting Template page, provide a name for the template and specify the location where SUDO or PowerBroker is located (for PowerBroker, you can optionally provide the password prompt), and click Save.

  6. On the Manage Privilege Delegation Setting Templates page, select the template you created and click Go.

  7. On the Apply '<delegation type>' Setting: New page, click Add Targets to apply the privilege delegation template settings to selected hosts, and click Apply.

    Note:

    If you do not apply the privilege delegation template to a target, and if you configure a step in the deployment procedure to run in Privilege Delegation mode, then the deployment procedure for that target runs the step in normal mode instead.
  8. After creating the template, to understand how it can be applied to Deployment Procedures, see Using SUDO, PowerBroker, and Privilege Delegation Settings.

Testing Privilege Delegation Settings

After creating a privilege delegation template and before applying it to a Deployment Procedure, Oracle recommends you to test the privilege delegation setting.

The following is an example that describes how you can register your credentials as preferred credentials and also choose to run as another user, and then test the settings by creating a job that checks whether a command is being as normal user or as another user using privilege delegation mechanism.

  1. In Grid Control, from the top-right coner, click Preferrences.

  2. On the General page, from the left menu bar, click Preferred Credentials.

  3. On the Preferred Credentials page, for the Host target type, click the Set Credentials icon.

  4. On the Host Preferred Credentials page, in the Target Credentials section, specify the normal user name, the normal password, and the Run as user name that you want to switch over to using the privilege delegation mechanism. Then click Apply.

  5. After registering the credentials as preferred credentials, click the Jobs tab.

  6. On the Job Activity page, from the Create Job list, select OS Command, and click Go.

  7. On the Create OS Command Job page, in the General tab, specify a name for the job. Then, from the Target section, click Add to add the host on which you want to run the OS command.

  8. In the Parameters tab, for Command, specify the command id.

  9. Click Submit.

  10. On the Job Activity page, click the job name you just created. Enterprise Manager Grid Control displays the status of the job. Click the status column to view its results.

    Ideally, Enterprise Manager Grid Control should have switched over from normal user to another user, which you specified for Run as on the Host Preferred Credentials page, and run then run the OS command.

Using SUDO, PowerBroker, and Privilege Delegation Settings

You can use SUDO, PowerBroker, and so on globally using the Privilege Delegation mechanism, that is, for all steps, or only for some steps within a Deployment Procedure. This section explains the following:

Making Global Settings

On the Deployment Procedure Manager page, select a Deployment Procedure and click Create Like to customize it. On the Create Like Procedure page, for Privilege Delegation, you can specify the user and the profile that the step must run as. The values you provide here will be used for all the steps within a Deployment Procedure.

PDP Settings

Making Step-Level Settings

On the Deployment Procedure Manager page, select a Deployment Procedure and click Create Like to customize it. On the Create Like Procedure page, for a particular step, from the Run Privilege column, select Privilege Delegation, and specify the Run As value in the first text box and the Profile value in the second text box. For example, for SUDO, the Run As value can be /usr/bin/sudo -u root, and the Profile value can be left blank. Similarly, for PbRun, the Run As value can be /opt/pbrun -l -u root, and the Profile value can be admin.

Applying Settings

Note:

These values need to be overridden only if a different user is required to run that step. Otherwise, the default values are used from preferred credentials registered with Enterprise Manager Grid Control. For example, if the preferred credentials for the host have been set to Oracle as the Run As user, but if the current step needs to be run as root, then you can enter /usr/bin/sudo -u root in the Run As text box.

For file transfer-based job steps, you can apply the Privilege Delegation settings while editing that step. For example, one of the steps in the One Click Extend Cluster Database deployment procedure is Copy Archives. This is a file transfer-based job step for which you can apply the Privilege Delegation settings. To do so, you can click the step name and on the Map Parameters page, in the Run Mode section, from the Run Privilege for Source Target list and Run Privilege for Destination Target list, select Privilege Delegation. Then provide the Run As value and the profile that must be used.

Applying Settings

Note:

For configuration collection-based job step, you can NOT apply any Privilege Delegation settings. For example, one of the steps in the One Click Extend Cluster Database deployment procedure is Refresh Host Configuration. This is a configuration collection-based step for which Privilege Delegation settings cannot be applied.

Changing Error Handling Modes

Every step in a Deployment Procedure is preconfigured with an error handling mode that indicates how the Deployment Procedure will behave when the phase or step encounters an error. The error handling modes offered by Enterprise Manager Grid Control are:

For more information about steps, see Understanding Phases and Steps.

To change the error handling modes, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure you want to customize, and click Create Like.

  4. On the Create Like Procedure page, select a phase or step, and from the list provided in the Error Handling Mode column against that phase or step, select the mode you want to set.

    Once the mode is selected from the list, Enterprise Manager Grid Control automatically refreshes the page with the newly selected mode for that phase or step.

The following is an example that illustrates how you customize the Oracle Database Provisioning Deployment Procedure to change the error handling mode of the Destination User Permission Checks phase:

Changing Error Handling Mode

Customizing Directives

Directives are essentially scripts stored in the Software Library. They are used in Deployment Procedures within a Directive Step, which is a special type of action step. For more information about Directive Step, see Understanding Phases and Steps.

If you want to customize a directive offered by Enterprise Manager Grid Control, then first create a copy of the Perl script associated with that Directive and make a new directive out of that copy. Then customize the Deployment Procedure to modify a step to use this new directive, and then schedule the deployment. This section explains the following:

Creating Copy of a Default Directive

To create a new customized directive using a default directive, follow these steps:

  1. In Grid Control, click the Deployments tab and then the Provisioning secondary tab.

  2. On the Provisioning page, click Directives.

  3. On the Directives page, from the table, expand Oracle Directives and then expand other levels under this category to reach the directive you want to copy.

    For example, if you want to copy the Apply Patch directive of a patching operation, then expand Oracle Directives and then expand Patching. From this level, expand Common, and then All, and finally Generic. Under Generic, you should see the directive Apply Patch.

  4. Select the directive you want to copy and click Edit. Open the Perl script, copy the contents of it to a local editor, and save it locally.

Storing the New Directive

To store the new directive, follow these steps:

  1. In Grid Control, click the Deployments tab and then the Provisioning secondary tab.

  2. On the Provisioning page, click Directives.

  3. On the Directives page, click Create Folder to create a folder titled Custom Directives. This is to ensure that you separate the custom directives from the default directives.

  4. On the Directives page, from the table, select Custom Directives and click Create Directives.

  5. In the Create Directive wizard, do the following:

    1. On the Describe page, describe the directive you are creating.

    2. On the Configure page, click Add to specify the command line arguments to be passed to the Directive. Set the Shell Type to Perl because you are adding a Perl script. If the script is neither Perl nor Bash, then set it to Defined in Script.

      Each entry represents a single command line argument. Each argument may include a variable to be set later, a prefix and suffix. The prefix and suffix text are appended before and after the property value to produce the command line argument.

      Repeat this step to add all the command line arguments.

    3. On the Upload File page, select Upload from Local Machine and click Browse to select the script from the local system where you saved the file.

    4. On the Review page, review the information you have provided for this new directive, and click Finish.

Customizing Deployment Procedure to Use the New Directive

To customize a Deployment Procedure to use the new directive, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure for which you want to use this new directive, and click Create Like.

  4. On the Create Like Procedure page, do the following:

    1. From the table that lists all the steps within that Deployment Procedure, select the directive step with which you want to associate the new directive, and click Edit Step.

    2. In the Edit Directive Step wizard, do the following:

      1. On the Edit page, click Next.

      2. On the Select Directive page, select Select New Directive. Then search and select the new directive you created, and click Next.

      3. On the Map Properties page, specify the values for the directive properties, and click Next.

      4. On the Review page, click Finish.

    3. Click Save.

Running the Customized Deployment Procedure

To run the customized Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the customized Deployment Procedure and click Schedule Deployment.

Setting Up E-Mail Notifications

Enterprise Manager Grid Control can send e-mail notifications to report the status of a Deployment Procedure. However, by default, Deployment Procedures do not have this feature enabled. To configure Deployment Procedures to send e-mail notifications, you must first customize them and enable the e-mail notification option, and then enable the Send E-mail option for the standard PAF Status Notification rule. This section describes how you can enable e-mail notifications for Deployment Procedures. In particular, this section covers the following:

IMPORTANT:

As a prerequisite, you are expected to have configured the Mail Server and set up the e-mail address in Enterprise Manager Grid Control. If you have not already done this, see the chapter on Configuring Notifications in the Enterprise Manager Configuration Guide available at:

http://www.oracle.com/technology/documentation/oem.html

Enabling E-Mail Notifications

To enable e-mail notifications in a Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the Deployment Procedure for which you want to set up e-mail notification, and click Create Like.

  4. On the Create Like Procedure page, do the following:

    1. Select Enable Notification.

    2. (Optional) For Procedure Status Notification Job Tag, provide a notification tag name.

      Note:

      Ensure that you specify not more than 30 characters. The text you specify here will be prepended to the notification job name.
    3. For Status for which Notification is to be Sent, select the state for which you want the notifications to be sent.

    4. Click Save.

      Enterprise Manager Grid Control displays the Deployment Procedure Manager page.

  5. On the Deployment Procedure Manager page, from the top-right corner, click Preferences.

  6. On the General page, do the following:

    1. In the E-mail Address section, click Add Another Row to add a row in the table, and specify the e-mail address to which the notification should be sent.

    2. Click Apply.

    3. From the left menu bar, click Rules.

  7. On the Notification Rules page, do the following:

    1. From the table, select PAF Status Notification, and for this notification rule, enable the Send E-mail option from the Subscribe (Send E-mail) column.

    2. Click Apply.

Customizing PAF Status Notification Rule

You can customize the standard PAF Status Notification rule to receive notifications in required ways for specific deployment procedures. For example, you might want to be notified by e-mail for a test system procedure, but for a production run you might want to be informed of the status through SMS Alerts.

To incorporate specific requirements and enable different methods of notification, you should use the Create Like function to modify the standard notification rule and edit the job with the specific notification tag name used in the Deployment Procedure and associating specific method of notification from the pre-defined notification methods.

To customize the standard PAF Status Notification rule, follow these steps:

  1. In Grid Control, from the top-right corner, click Preferences.

  2. On the General page, from the left menu bar, click Rules.

  3. On the Notification Rules page, from the table, select PAF Status Notification, and click Create Like.

  4. On the Create Notification Rule page, do the following:

    1. On the General page, specify a notification rule name and a brief description for the rule.

Customizing Deployment Procedures to RollBack Patches

To roll back patches, you must first download the rollback Perl script, then upload it as a directive to the Software Library, and then use it with a customized Deployment Procedure. This section explains how can perform each of these tasks. In particular, this section covers the following:

Downloading Rollback Perl Script

To roll back patches, you have to use the Perl script rollback_patch.pl. This script is available as an attachment to My Oracle Support Note: 577557.1. Access this note and download the script to your local system.

Storing the Script as a Directive

To store the rollback_patch.pl script as a directive in the Software Library, follow these steps:

  1. In Grid Control, click the Deployments tab and then the Provisioning secondary tab.

  2. On the Provisioning page, click Directives.

  3. On the Directives page, click Create Folder to create a folder titled Custom Directives. This is to ensure that you separate the custom directives from the default directives.

  4. On the Directives page, from the table, select Custom Directives and click Create Directives.

  5. In the Create Directive wizard, do the following:

    1. On the Describe page, specify the name Rollback Patches and provide the description Directive to roll back patches in rollback or nrollback mode. Click Next.

    2. On the Configure page, click Add to specify the following command line arguments to be passed to the Directive: oh, patchid, stageDir, command, patchsetRelease.

      Set the Shell Type to Perl because you are adding a Perl script.

    3. On the Upload File page, select Upload from Local Machine and click Browse to select the script from the local system where you saved the rollback_patch.pl file.

    4. On the Review page, review the information you have provided for this new directive, and click Finish.

Customizing Deployment Procedure to Use Rollback Directive

To customize a Deployment Procedure to use the new Rollback Patches directive, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select a patching Deployment Procedure that you want to customize for using this new directive, and click Create Like.

  4. On the Create Like Procedure page, do the following:

    1. From the table that lists all the steps within that Deployment Procedure, select the Apply Patch directive step with which you want to associate the new directive, and click Insert.

    2. In the Insert Directive Step wizard, do the following:

      1. On the Create page, provide a name and description. From the Insert Location list, select Before "Apply Patches". From the Type list, select Library: Directive. Click Next.

      2. On the Select Directive page, select Select New Directive. Then search and select the new Rollback Patches directive you created. Select Always Use Latest Revision. Click Next.

      3. On the Map Properties page, specify the following values for the directive properties, and click Next.

        Table 31-4 Map Properties

        Directive Property Display Name to be Specified Description to be Specified Variable to be Specified

        Oh

        ORACLE_HOME

        Oracle home of the target

        Select Choose Variable and then select Target Variable: oraHome from the associated list.

        patchid

        Patch ID

        Comma-separated list of patch numbers

        Select Ask User at Run-Time

        stageDir

        Stage Directory

        Directory where the patch can be staged

        Select Choose Variable and then select replacedStageDir from the associated list.

        It can be also be set to a value where the patch is staged. However, this is required only for patches of release 10.1.0.x

        command

        Rollback Command

        Rollback command to run

        Select Ask User at Run-Time

        patchsetRelease

        Patch Set Release Version

        Patch set release number

        Select Ask User at Run-Time


      4. On the Review page, click Finish.

    3. Click Save.

Running the Customized Deployment Procedure

To run the customized Deployment Procedure, follow these steps:

  1. In Grid Control, click the Deployments tab.

  2. On the Deployments page, from the Deployment Procedure Manager section, click Deployment Procedures.

  3. On the Deployment Procedure Manager page, select the customized Deployment Procedure and click Schedule Deployment.

  4. In the Deployment Procedure Wizard, provide the required information and submit it for deployment.

    On the Library Step Properties page, you will be prompted to specify the patch ID, the rollback command, and the patch set release version. Specify the following vales on this page:

    Table 31-5 Values for Library Step Properties Page for Rolling Back Patches

    Library Step Values to be Specified

    Patch ID

    Specify the patch number you want to roll back. If you want to roll back multiple patches, then specify the patch number separated by a comma.

    Rollback Command

    Specify rollback for normal patches and nrollback for Napply CPU patches.

    Patchset Release Version

    Specify the release for which the patch is being applied.