Tuesday, October 11, 2016

Oracle Alerts in R12

1  Overview of Oracle Alerts
2  Defining Alerts
3  Type of Alerts
4  Check the Alerts

Overview of Oracle Alerts:

·                      Keep you informed of critical activity in your database
·                      Deliver key information from your applications, in the format you choose
·                      Provide you with regular reports on your database information
·                      Automate system maintenance, and routine online tasks

Overview:


Oracle Alert is your complete exception control solution.

Oracle Alert facilitates the flow of information within your organization by letting you create entities called alerts to monitor your business information and to notify you of the information you want. You can define one of two types of alerts: an event alert or a periodic alert.

An event alert immediately notifies you of activity in your database as it occurs. When you create an event alert, you specify the following:

·                      A database event that you want to monitor, that is, an insert and/or an update to a specific database table.
·                      A SQL Select statement that retrieves specific database information as a result of the database event.
·                      Actions that you want Oracle Alert to perform as a result of the database event. An action can entail sending someone an electronic mail message, running a concurrent program, running an operating script, or running a SQL statement script. You include all the actions you want Oracle Alert to perform, in an action set.

A periodic alert, on the other hand, checks the database for information according to a schedule you define. When you create a periodic alert, you specify the following:

·                      A SQL Select statement that retrieves specific database information.
·                      The frequency that you want the periodic alert to run the SQL statement.
·                      Actions that you want Oracle Alert to perform once it runs the SQL statement. An action can entail sending the retrieved information to someone in an electronic mail message, running a concurrent program, running an operating script, or running a
·                     SQL statement script.


Defining Alerts:


Navigator: Alert Vision Manager USA

To define Alerts

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX0IkdkJCBd_87F6mHFYZ-LiKG9xY9AbQFivaw5caReDo9yk7rpHsNf62gQZ9EphirSe_UmHULD8MdkV2uuVuCPeCPTQd3ey5A11HqLPuW2g_vndzSA0c5k6KkhnIpm7w2Kk0tDh5sygo/s320/image001-734096.png

Types of Alerts:

1. Periodic Alerts


Periodic alerts periodically report key information according to a schedule you define.

To define a periodic alert:
1. Navigate to the Alerts form.
2. Enter the name of the application that owns the alert in the
Application field. This application must reside in the same Oracle database as Oracle Alert.
3. Name the alert (up to 50 characters), and give it a meaningful description (up to 240 characters).
4.Enter a name for the alert that is unique within the application. Use an initial character other than a pound sign (#), a colon (:), or a percentage sign (%).

1.                  Select a frequency for your periodic alert. You can choose from nine frequency options:
2.                   
Frequency :

On Demand             :-We have to run the alert to fire.

Enter which Application u want to specify alerts, name of the alert,
Click whether its periodic or Event

On Day of Month: It will fire last day of every month.
It will start from 12 AM up to 11 AM morning and each 2 hours interval the alert will fire once.
           Exa: 12AM, 2 AM, 4 AM … … … … 8am, 10am.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLU0w58EYbT2SzfW_7RjxrPqq-vHg7YLJNiALDQQGbWz4jLVdJJbB6SxRJyFlvxhrfyiKgZ0Bms1kU5vzz0M-FW23qKxpV-h6StThPloVUgdKsgpH6U37GBLe1oVin-cyjoyQUJvnm4xQ/s320/image002-737933.jpg

On Day of Week : Same as On day of Month.

Every N Calendar day: It will fire in each two days.

Every N Business Day: It will fire once in each three business day.(It will not count the holidays)

Every Day:  It will fire daily

Every Other Day :  It will fire in a alternative day.

Every Business Day: It will fire every day except holiday.

Every Other Business Day: It will fire in an alternative business (working) day.
i.e  It will not consider holidays

Import :  We can import the files(which contain the query) if the query size is big, if it exceed the memory.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilEbPj-MsIpszgzxuVFz_NjyblbHpXXbJOd-gqTEkoVszmp2fLsUIKTtZqGQAdtYzPJRfbpLsT26G4UNOqojvXRmw04WuRNGeAFfb7Qu85XncVLsm_hv-yO27404tbphlQ8jH8U_J_T78/s320/image003-742530.jpg

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpcZnh0Fr8PQ5WfZU5WtnjSoWAcuA31bawW1T3HpbF4aSU92tDux1vHlbT-AZ5WHEqKhs03NfPggbsnMUr91T8mTg17HMFydrTisEP2M7Cu6VTqHTBzhVTKKCoSit_I9XCit68shRfiA4/s320/image004-749943.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPDcFUIDdqMOmxIQKlyszJW8cCLLcHmuG_kaWZbSR40_-fBYIptKLDO0YFDdg_ygIphqEsHpqIjQg7xUafpf1YfrOp_ZI1Zdy6j-LI57gb38t3FWUXD4J91_dYJoLO_LTuVib1bfWIduI/s320/image005-752458.png


After writing the Query in Select Statement area click on Verify  to verify the query and
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfOSsQO5tyPFBrb61pIQh-7p4-nBbLmnh98ZqsSe3QeBDqc2KCPx-7lv0wU6mfjYTyryMidTgh-HCYhAtR61ldoWJ3l3MXFvOtzaWVszVrzlomijFfkvuJ53IRD-NXPHqjkhSti4GyQqw/s320/image006-765184.jpg

After Click on Verify Button the following message will come.
        Click on OK and Save

Then click on Run  to execute the query. 
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYC2vy-o9ZTveGNz92ky_kc4A1-06JwbSfPnW1Pbk80uSXlwrP1hH7nlBN-CPvh2Bdo96ew8muN_LSgYqoWIRYSp9VAdV_QdRhkDLUPaSiBZ9ScdAu9xFntnua62ch_oNzzwpCMbSlXfM/s320/image007-771352.jpg
            Click on Run  button , the following screen will come. And click on OK.

2 . Click on Actions  Button and enter the Action information  like following screen
Details Action perform once for each exception found,
Summary Action perform once for all exception found
No exception performs when no exception was found.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj4BIgcZtutx4-h2g3VmlRSgmad8zsrrlceGpOOXzGJbfctcjhbN0aaGNd3zbvksiw1WDvsx0aUaY2lf15RzL4YbUa6p8y2c_5uGlwaNHyDr4GBfo2eZ_OOlkFARwRj91TNIVcqiMb6JM/s320/image008-786989.jpg

2.click on Action Details  and enter the value  and save.
Concurrent Program :  Used to execute the Concurrent program.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAk9pu0SRJbjW3baBsPPzL3PiolTMURKeM79qjRs9krDEjHThu-8sehpXcWf3Z2BAgM8C_nP9GD7ZqLuJpgFWrGo2Jg5SRyTw1ow-3HpauQ8WBIXdKcHvpmtClAXYnkqVNAIp3ZECeBxw/s320/image009-700468.jpg

Message : Used to send the message via mail.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ6dIWCI29YjPXLa-hmIn5wHtn-2ma-mxjc9R8zE3yM3oy6rN4RQW6I-DR3pVK5s6PWlrOIUEZlKjbJ2xFs5o68f35r1m60kmp7PzIefjDlH9Op0CqF3VB177t5m94_St0GrDPeHwlwQI/s320/image010-706753.jpg

Operating System Script:  Used to run the OS Script.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvEQUjdcg-CdYtF1i15bFWkgGimtEdJNRKNRlTCxGQBeiswjL_ykaYXtGpVHVhaz51zDk_23CaOEZAXaz16Q7eSwAQsZkVCbfvjbojOwCY03CS2eibJZnZLa4pZhmMAVhNbjisOrteeGg/s320/image011-710866.jpg

SQL Statement Script : Used to run the SQL statement Script.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpJoQkVpNkGJKFhQj1O9p7GN0eUlBqwC3RKq6AtiS9r_NVIwLdrIeHMf-OZwbUNMbGQGuJoHd-V6KG-IM-4WmroeE9-2MvQZN4Kg3k8xE3K-jcNgO1nl0p5613-ldGWFweyHFlryJXe_g/s320/image012-715440.jpg

3. Click on Action Sets   button   from Alert window
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuxzxWdspEFKvPwkFHFfY-mwCtuB6AhigU1cimFUplFwvRjfkMyLtHLjpOpHx7KxfdEl0xpll2ahJ547DWZBvsLANzjHHOaVdupXFMe6iLJFG6lzHv-7CZKxwHbR9pGDyLCRqVvOuf03Y/s320/image013-721165.jpg
Then click on Action Set Details
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdHsFTyhBWrAVsEsxhBLOBcS_VRinmqLKaW5fb1Gx2DzB3VCzbz1toAilkBdEYN7PpebbaGIFvxeR2_mgxfAHqso_dZAyqq5MKrCMUyvnnmGjfosVdnx9gxra3caPvSGQoql2V9bHNakY/s320/image014-726308.jpg
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVzr78eaxJv8xKYjADZ1zyMEnk5T0v6CsfyYBOmDZ3yb9oDZgJNafF9ZMRU6SlW7zGCWxAvXMeY4-KgQGuORTohRqYG2voaeBgmB3W_KKPib7IxsU2MuonBKxMzGin4xpNQFHJ7lrn-T0/s320/image015-731530.jpg

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhFyvjlAk8Z5I4HbTiVuRIQzJ5Ks2XZnHNRYNmNwoPiDpDlWpIcCYX2fo0nbIQIUXIRz0SGQECw-LN95CHOyyIMLls8TTwbVbjB4EuhT_giF4JpEflc27oUyoxmD6nCKmmD4tw3wp5HzM/s320/image016-735958.jpg

4. Then click on Alert Details from the Alert window and enter the value and save.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1rsKflhB3LMoPzsmiVe27JeoYK4K8zztV7MF3q0y5yIVih19M892QuE7Of73EMPfxtBgoDRrA9Fgs5B1I9xtS0vK3kn11l20U7iLnhLOmnhoylp_Rj0ZG03KpQm6w_uphpa8WZAnZkUE/s320/image017-740070.jpg

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKwZflJXYY0pCnUUD3pXYuUQ_zTJTZVZkQ3cRY9LhMf4o54CI9AFtbCaKRjtOd9Yik1kSE4kLQDIcomRuWnLj7M80A4HrIhOzlsEmVtUFwieIFH1mvr_tcrOEVBlVNk93tYZBZPhFI4KQ/s320/image018-745225.jpg


Event Alerts:        


Creating an Event Alert
To create an event alert, you perform the following tasks in the order listed:
• Define the database events that will trigger your alert
• Specify the details for your alert
• Define actions for your alert
• Create action sets containing the actions you want your alert to perform
This section focuses on the first task of defining the database events that trigger your event alert and divides the task into smaller sub–tasks.

To define an event alert:
1. Navigate to the Alerts form.
2. In the Application field, use the list of values to choose the name of the application that owns the alert. This application must reside in the same Oracle database as Oracle Alert.
3. Name the alert (up to 50 characters), and give it a meaningful description (up to 240 characters).
Enter a name for the alert that is unique within the application. Use an initial character other than a pound sign (#), a colon (:), or a percentage sign (%).
4. In the Type field, choose Event.
5. Check Enabled to enable your event alert.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjon8zLO4xUxpvyyvX0ldJYNkYA8P96Bve09DQQOBXk7g0xDxJ2EsiGZc64E1zbwosAqhkEwAyowRhOac3KzEHrFHF_9ZvIZRV2y7qeyejCZ9WbBl3Rz8r-E8drEwuteX667QEbZHedSLA/s320/image019-748115.jpg

To specify the alert details for an event or periodic alert:
1. With your alert definition displayed in the Alerts form, choose Alert Details. The Alert Details window that appears contains three tabbed regions: Installations, Inputs, and Outputs.

2. In the Inputs tabbed region, Oracle Alert automatically displays the inputs used in your Select statement, unless they are the implicit

inputs: :ROWID, :MAILID, :ORG_ID and :DATE_LAST_CHECKED.

The values of the implicit inputs are as follows:

• ROWID—Contains the ID number of the row where the insert or update that triggers an event alert occurs.
• MAILID—Contains the email username of the person who enters an insert or update that triggers an event alert.
• ORG_ID—Contains the organization ID that is selected when the alert runs.
• DATE_LAST_CHECKED—Contains the date and time that the alert was most recently checked.

3. You can optionally add a description for each input, but you must specify the data type (either character, number, or date) for the input, because Oracle Alert uses the data type to validate the default values for inputs you enter in the Default Values field and in the Action Set Inputs tabbed region of the Action Sets block.

4. Enter a default value for your input. You can enter up to 240  characters. This value automatically becomes the default value for your input in each action set you define.

5. In the Outputs tabbed region, Oracle Alert automatically displays the outputs used in your alert Select statement without the ampersand (&) and any numbering format. You can add meaningful descriptions for the outputs.

6. You can specify the maximum number of output characters you want to display in your detail or summary message actions. See: Formatting Summary Message Actions:

7. If your output value is numeric, enter the SQL*Plus format mask in the Number Format field.

8. You can also check the Check for Duplicates check box to customize the combination of outputs you want to verify as a possible duplicate exception each time the alert is checked. A duplicate exception is an exception that existed in your database during previous alert checks. You can define Oracle Alert to perform certain actions based on the presence of these duplicate exceptions.

9. In the Installations tabbed region, specify an Oracle ID if you want Oracle Alert to check your alert against that specific Oracle ID. You can select only those Oracle IDs that are associated with the application that owns your alert.
If you do not specify an Oracle ID in this region, Oracle Alert checks your alert against all installations in your database of the application that owns your alert.

10. If you have multiple organizations defined in your Oracle Applications schema, you must specify the organization you want the alert to run against in the Operating Unit field.

Click Action details,

In Action details Navigator
They are four types of Actions

Concurrent Program :       Used to execute the Concurrent program.
Message :                             Used to send the message via mail.
Operating System Script:  Used to run the OS Script.
SQL Statement Script :      Used to run the SQL statement Script.

Check the Alert:

1.                  Go to Alert Manager
(N) Request>Check
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlSUZWPUU8sl-BhBymBUqGx3JEl8s0sqZlwXcrYyxOiuZfr1zzsmfnVkMEXx2ITDnPeYkLuwp6zrp6Tz5scuK4zP2HYXxFviLNrN8HVVEXMArsqlD7RAJSKt_XEPrZr5NPrXLN-k4Pg3U/s320/image020-756217.png

Then View> Request >Find from Alert Manager responsibility.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSofPAzf0xxn4-WdUHNmsNUYdCvQitH2cIQn_TZeenfzruMSxqQrZDBfX7SDl1-Gqkocad_tA7IwKbN_4IiJXfr17sLczMVCfutbwkNpJlTP0vSMw17H_wKpEkBBCAT11viuvB6s8ZbfY/s320/image021-766373.jpg

After completed Normal check the mail.

Query to Find Out Oracle Alerts

The following query finds all enabled custom alerts. You can comment out the very last two lines (alr.enabled_flag and alr.created_by) to display all both enabled and disabled alerts.

-------------------------------------------------------------------------------
-- Query to find Custom Oracle Alert
-------------------------------------------------------------------------------
SELECT alr.application_id,
alr.alert_id,
alr.alert_name,
alr.start_date_active,
alr.description,
alr.sql_statement_text
FROM alr.alr_alerts alr
WHERE 1=1
AND alr.created_by <> 1 -- show only custom alerts
AND alr.enabled_flag = 'Y'; -- show only enabled alerts


Oracle Apps Alerts Tables:

Oracle Apps Alerts Table
ALR_ACTION_DATA
ALR_ACTION_GROUP_MEMBERS
ALR_ACTION_GROUPS
ALR_ACTION_HISTORY
ALR_ACTION_OUTPUTS
ALR_ACTION_SET_CHECKS
ALR_ACTION_SET_INPUTS
ALR_ACTION_SET_MEMBERS
ALR_ACTION_SET_OUTPUTS
ALR_ACTION_SETS
ALR_ACTIONS
ALR_ACTUAL_RESPONSES
ALR_ALERT_CHECKS
ALR_ALERT_INPUTS
ALR_ALERT_INSTALLATIONS
ALR_ALERT_OUTPUTS
ALR_ALERTS
ALR_ALERTS_A
ALR_DISTRIBUTION_LISTS
ALR_LOOKUPS
ALR_MESSAGE_SYSTEMS
ALR_ORACLE_MAIL_ACCOUNTS
ALR_OUTPUT_HISTORY
ALR_PERIODIC_SET_MEMBERS
ALR_PERIODIC_SETS
ALR_PROFILE_OPTIONS
ALR_RESPONSE_ACTION_HISTORY
ALR_RESPONSE_ACTIONS
ALR_RESPONSE_MESSAGES
ALR_RESPONSE_SETS
ALR_RESPONSE_VARIABLE_VALUES
ALR_RESPONSE_VARIABLES
ALR_VALID_RESPONSES

Oracle Fusion - Cost Lines and Expenditure Item link in Projects

SELECT   ccd.transaction_id,ex.expenditure_item_id,cacat.serial_number FROM fusion.CST_INV_TRANSACTIONS cit,   fusion.cst_cost_distribution_...