Creating Alert Actions
After you define your alert you need to create the actions you want your alert to perform. There are four types of actions you can create:
- concurrent program actions
- SQL statement script actions
To create an action for an alert:
1. Display the alert that you want to create an action for in the Alerts form.
2. Choose Actions to display the Actions window.
During an alert check, a detail action performs once for each individual exception found, a summary action performs once for all exceptions found, and a no exception action performs when no exceptions are found.
5. Choose Action Details to display the Action Details window.
6. Select the type of action you want to create in the Action Type field: Message, Concurrent Program, Operating System Script, or SQL Script.
Depending upon the action level and type you choose, different fields appear in the Action Details window.
Note: If you integrate with Oracle Office to process your outgoing mail, Oracle Alert first validates with Oracle Office all the electronic mail IDs listed in the To, Cc, and Bcc fields before sending the alert message.
If an ID is invalid in any of these fields and the action is part of a periodic alert, Oracle Alert returns the message to the user who last updated the periodic alert.
If an ID is invalid in any of these fields and the action is part of an event alert or an on demand periodic alert, Oracle Alert returns the message to the user who invoked the alert.
In both cases, Oracle Alert determines the user's electronic mail ID from the value entered in the E-Mail field of the Users form (from the System Administrator responsibility). If the value of E-Mail is null, Oracle Alert then checks whether the value for the Default User Mail Account option listed in the Oracle Alert Options form is set to Operating System Login ID or Application Username and sends the message to the appropriate user using one of these two IDs.
This electronic mail ID validation is disabled if you integrate with other electronic mail systems to send outgoing messages.
3. You can also enter in the List field, a distribution list that you define in the Distribution Lists window. See: Defining a Distribution List.
If you enter a distribution list name, Oracle Alert displays all electronic mail IDs on the list in the To field, and does not let you change any values in the To, Cc, Bcc, Print For, or Printer fields. If you want to use an Oracle Office public mail list, enter the list name in any of the recipient fields.
4. You can specify a value in the Reply To field that overrides the default Oracle Alert mail account that appears in the Reply To prompt of message actions. You can enter more than one Reply To mail ID, if appropriate. You can enter up to 240 characters.
If you integrate with Oracle Office to process your outgoing messages, Oracle Alert uses Oracle Office to first validate the electronic mail IDs listed before sending out the alert message action.
Oracle Alert prints the message preceded by a banner page with the name as it appears in the Print For User field. You can enter as many names as you want, up to 240 characters.
6. In the Subject field, enter a brief statement that describes the message's subject matter. You can enter up to 240 characters.
For example, if you define an alert that reminds users to change expired passwords, you can define an alert output called &USER to hold the user's electronic mail ID. Enter &USER in the To: field to have Oracle Alert send a message to each user whose password has expired.
If you want to send the contents of a file, choose the File option and enter the file name (including the full path), or the output from the alert Select statement that represents the file name and location, in the File field. You may use any outputs to construct the file name.
Note: If this message action has a response set associated with it, you must define the text of the message within Oracle Alert.
9. For detail message actions, Oracle Alert distributes one message for each exception found during an alert check. Place outputs wherever you need to in the message text, to format your message as you like. When Oracle Alert sends the message it substitutes the output variables with the exception values found during the alert check.
11. For a no exception message action, Oracle Alert distributes a message when no exceptions are found for an alert check. Do not use outputs to define your no exception message and recipients.
Note: If you decide to change the Action Level of your action after entering message text in the Text field, you must delete the message text yourself. Oracle Alert does not automatically delete the text for you.
Attention: For detail or no exception message actions, the message text that you specify in Oracle Alert must be less than 2000 characters, while the message file that you specify must be less than 64K.
12. For summary message actions, complete your action details by following the instructions listed in the next section.
14. When you are done defining actions, close the Actions and Action Details window and choose Action Sets to define the action set(s) for your alert definition. See: Creating an Action Set for an Alert.
To complete the action details for a summary message:
1. Choose the Text option. A Summary Message Template appears in the text field.
2. You can place outputs anywhere in the three parts of the summary message body: above the summary template in the opening text, within the Summary Message Template, and after the summary template in the closing text.
3. Enter the opening text of your summary message at the top of the window above the summary template. Use this area to enter any introductory text that you want to precede the columns in your message and to lay out your column headings.
Suggestion: You can use any output values in the opening text of your summary message. Use outputs like current date (if you want to display the date that the exception was found) in the introductory text of the message to avoid repeating the date as a separate column in the summary.
The number of characters your message displays for each output depends on the number of characters you allot for each output in the Max Length field in the Outputs alternative region of the Alert Details window. The ampersand (&) of the output defines the left margin of an output's column area. Oracle Alert defines the right margin of an output's column area as two spaces to the left of the next column. Oracle Alert left-justifies any character or date outputs within that output's column area. For number outputs, Oracle Alert right-justifies the data within the column area. If the output in the rightmost column is defined as a number, Oracle Alert right-justifies the data in a column 15 characters wide. If the numeric data is wider than the column width allotted, Oracle Alert displays '###' in the message. See: Formatting Summary Message Actions.
5. If you want to use multiple lines per exception, position your outputs on as many lines as you need, in the positions you want. If you want a blank line between each set of exceptions, leave a blank line between your outputs and the lower summary template line.
6. Enter the closing text below the summary message template. You can use any outputs in your closing text.
Note: If you decide to change the Action Level of your action after entering message text in the Text field, you must delete the message text yourself. Oracle Alert does not automatically delete the text for you.
Attention: For a summary message actions, the message text that you enter in Oracle alert must be less than 2000 characters, while the message file that you specify must be less than 64K.
12. When you are done defining actions, close the Actions and Action Details window and navigate to the Action Sets window to define action sets for your alert definition. See: Creating an Action Set for an Alert.
1. Choose Concurrent Program in the Action Type field of the Action Details window.
2. Enter the name of the application that owns the concurrent program you want to define as an action.
3. Enter the name of the concurrent program.
4. Enter any arguments for the concurrent program in the Arguments field, each separated by a space.
You can use output variables from the alert SQL statement or response variables to dynamically pass arguments to your concurrent program. If your concurrent program action uses arguments that select character or date data, place single quotes around your argument so that Oracle Alert can correctly pass the data.
6. For detail concurrent program actions, Oracle Alert submits the concurrent program request once for each exception found during an alert check.
7. For summary concurrent program actions, Oracle Alert submits the concurrent program request once for each unique combination of critical output values. Outputs used as arguments are considered critical outputs.
8. For no exception concurrent program actions, Oracle Alert submits the concurrent program request if it finds no exceptions during an alert check. Do not use outputs when defining your no exception concurrent program actions.
10. When you are done defining actions, close the Actions and Action Details window and navigate to the Action Sets window to define action sets for your alert definition. See: Creating an Action Set for an Alert.
1. Choose Operating System Script in the Action Type field of the Action Details window.
2. If the operating system script you want to execute is in a file located in an Application's base path bin directory, specify that Application name in the Application field.
3. Enter any arguments you want to pass to the operating script in the Arguments field, each separated by a space.
You can use output variables from the alert SQL statement or response variables to dynamically pass arguments to your operating system script. If your operating system script action uses arguments that select character or date data, place single quotes around your argument so that Oracle Alert can correctly pass the data.
4. Choose File if the operating system script resides in a file.
5. If the operating system script is in a file, and you do not specify a value in the Application field, as specified above, then enter the full path of the operating system script, or the output from the alert SQL statement that represents the file name and location in the File field.
Note: Oracle Alert cannot substitute values into output variables located in an operating system script file.
Note: The operating script file must be less than 64K.
6. If you want to enter the script in Oracle Alert, check Text and type the script in the Text field. The script must be less than 2000 characters.
Identify your alert outputs with an ampersand before the name, for example, &OUTPUT_NAME.
8. For detail operating system script actions, Oracle Alert performs the operating system script once for each exception found during an alert check.
9. For summary operating script actions, Oracle Alert performs the operating system script once for each unique combination of critical output values returned by the alert Select statement. If the operating system script is found in a file, the outputs used as the file name and arguments are considered critical outputs. If the operating system script is found in the Text field, all outputs in the operating system script are considered critical outputs.
10. For no exception operating system script actions, Oracle Alert performs the operating system script if it finds no exceptions during an alert check. Do not use outputs when defining your no exception operating system script actions.
Attention: When performing an operating system action, Oracle Alert executes the commands with the privileges of the operating system user that started the Concurrent Manager.
12. When you are done defining actions, close the Actions and Action Details window and navigate to the Action Sets window to define action sets for your alert definition. See: Creating an Action Set for an Alert.
1. Choose SQL Statement Script in the Action Type field of the Action Details window.
2. If the SQL statement script you want to execute is in a file located in an Application's base path sql directory, specify that Application name in the Application field.
3. Enter any arguments you want to pass to the SQL statement script in the Arguments field, each separated by a space.
You can use output variables from the alert SQL statement or response variables to dynamically pass arguments to your SQL statement script.
4. Choose File if the SQL statement script resides in a file.
5. If the SQL statement script is in a file, and you do not specify a value in the Application field, as indicated in above, then enter the full path of the SQL statement script, or the output from the alert SQL statement that represents the file name and location in the File field.
Note: You can use PL/SQL for your SQL statement script action.
Attention: The SQL script file must be less than 64K.
6. If you want to enter the script in Oracle Alert, check Text and type the SQL script in the Text field.
Identify your alert outputs with an ampersand before the name, for example, &OUTPUT_NAME. If your SQL statement script action uses outputs that select character or date data, place single quotes around your output so that Oracle Alert can correctly pass the data. If a single quote lies within your character string, Oracle Alert adds a second single quote. For example, if your character string is resume', Oracle Alert displays this data as resume''. Follow SQL format conventions in the text of your SQL statement action, and place a semicolon (;) or a forward slash (/) at the end of each SQL statement.
Attention: The SQL script you enter must have less than 2000 characters.
8. For detail SQL statement script actions, Oracle Alert performs the SQL statement script once for each exception found during an alert check.
9. For summary SQL statement script actions, Oracle Alert performs the SQL statement script once for each unique combination of critical output values returned by the alert Select statement. If the SQL statement script is found in a file, the outputs used as the file name and arguments are considered critical outputs. If the SQL statement script is found in the Text field, all outputs used in the SQL statement are considered critical outputs. See: Formatting Summary Message Actions.
10. For no exception SQL statement script actions, Oracle Alert performs the SQL statement script if it finds no exceptions during an alert check. Do not use outputs when defining your no exception SQL statement script actions.
12. When you are done defining actions, close the Actions and Action Details window and navigate to the Action Sets window to define action sets for your alert definition. See: Creating an Action Set for an Alert.
1. Select the action you wish to delete in the Actions window of the Alerts form.
2. Choose from the Edit menu, Delete Record.
You can delete an action if there is no history for the action and the action is not an enabled member of an action set, response set, or action group (such as an escalation or threshold group).
3. If the action is an enabled member of an action group, action set, or response set, an error message followed by a References window appears.
You can also choose References from the Special menu in the Actions window at any time to display the References window.
You must navigate to the appropriate window and disable or remove the action from those< action groups, action sets, or response sets that reference the action before you can delete the action.
5. Once you delete your action, save your changes.
See Also
Defining a Response Processing Alert