Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
Event 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.
Periodic Alert:
A periodic alert, on the other hand, checks the database for information according to a schedule
you define. In a periodic alert specify the following:
• The frequency that you want the periodic alert to run the SQL statement.
• Actions that 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. We include
all the actions we want Oracle Alert to perform, in an action set.
On Demand
On Day of the Month
On Day of the Week
Every N Calendar Days
Every Day
Every Other Day
Every N Business Days
Every Business Day
Every Other Business Day
Enter a SQL Select statement that retrieves all the data your alert needs to perform the actions
you plan to define. Your periodic alert Select statement must include an INTO clause that
contains one output for each column selected by your Select statement.
Here is an example of a periodic alert Select statement that looks for users who have not changed
their passwords within the number of days specified by the value in :THRESHOLD_DAYS.:
SELECT user_name,
password_date,
:THRESHOLD_DAYS
INTO &USER,
&LASTDATE,
&NUMDAYS
FROM fnd_user
WHERE sysdate = NVL(password_date,
sysdate) + :THRESHOLD_DAYS
ORDER BY user_name
Although Oracle Alert does not support PL/SQL statements as the alert SQL statement
definition, you can create a PL/SQL packaged function that contains PL/SQL logic and enter a
SQL Select statement that calls that packaged function.
You can verify the accuracy and effectiveness of your Select statement. Choose Verify to parse
your Select statement and display the result in a Note window.
Choose Run to execute the Select statement in one of your application’s Oracle IDs, and display
the number of rows returned in a Note window.
Once you are satisfied with the SQL statement, save your work.
Once you define an event or periodic alert in the Alerts window, you need to display to the Alert
Details window to complete the alert definition. The Alert Details window includes information
such as which Application installations you want the alert to run against, what default values you
want your inputs variables to use, and what additional characteristics you want your output
variables to have.
• message actions
Choose Actions
Enter a name (up to 80 characters) and description (up to 240 characters) for your alert action.
Select the type of action you want to create in the Action Type field
Specify the name of the application and the database table that you want Oracle Alert to monitor.
Note: You cannot use a view as the event table for your alert.
Check After Insert and/or After Update if you want to run your event alert when an application
user inserts and/or updates a row in the database table.
Specify a value in the Keep _ Days field to indicate the number of days of exceptions, actions,
and response actions history you want to keep for this alert.
Specify a value in the End Date field if you want to disable your alert by a certain date.
ALR_ALERTS
ALR_ACTIONS
ALR_ACTION_SETS
ALR_ACTION_SET_INPUTS
ALR_ACTION_SET_OUTPUTS
ALR_ACTION_SET_MEMBERS
ALR_ALERT_CHECKS
ALR_ALERT_INPUTS
ALR_ALERT_OUTPUTS
ALR_ACTION_SET_CHECKS
ALR_RESPONSE_SETS
ALR_RESPONSE_ACTIONS
ALR_VALID_RESONSES
ALR_ALERT_ACTIONS_VIEW
ALR_ALERT_HISTORY_VIEW
ALR_CHECK_ACTION_HISTORY_VIEW
ALR_INSTALLATIONS_VIEW
ALR_PERIODIC_ALERTS_VIEW
ALR_RESPONSE_ACTIONS_VIEW
ALR_SCHEDULED_PROGRAMS
ALR_VARIABLES_AND_OUTPUTS
Periodic Alert: Periodic Alert Fires at pre defined set of Time.e.g suppose you want to Email all Order Booked today
We can Use Periodic Alerts.
Event Alerts: Event Alerts Fires when particular database activity occurs e.g inserting record and updating record of
tables.
Design of Periodic Alert is explained from scratch with the help of Test Alert
““Items with zero weight” .
We have to design periodic alert “Items with zero weight” for our Client.Basic
Business need of this alerts is for Email to MIS User for List of item having Zero
Weight saved in Oracle Inventory.
Query is: Test Query for “Items with zero weight” Alert is
SELECT
distinct p.organization_code ,
substr(i.segment1,1,20) ,
substr(i.description,1,50),
i.creation_date,
INTO
&org
, &item
, &descr
, &create_date
FROM
mtl_system_items i,
mtl_parameters p
order by 1,2
Verify: Click on Verify Button to Verify your Query. This message will populate if Query is Right.
Run: To Check Record Count of Your Query Click on Run Button. Suppose Your Query Written Zero
Rows This Message will populate.
Action Name:Specify Name of your Action. For Example Our Alert ““Items with zero weight”. is for
Email.we specify name “EMAIL” in Action Name.
Action Level: Action level should be Summary.
Action Detail: By Click on Action Detail Button this Window (Action Detail Window 1.1)
We Choose Action Type “Message” because “Items with zero weight” Alert is for Email Purpose.
Text : In Text field design Layout of your Periodic Alerts. “Items with zero weight” Alert Layout is this:
Important thing is that Output Variable &org,&item etc should be placed with in template like this…
The following items currently have no weight maintained against them in the system.
80 Characters
132 Characters
180 Characters
Action set Name: Enter Action Set Name. In our Test Alert we enter Action set Name “EMAIL”.
Note : Action set Name should be same as in Action Name. Otherwise Periodic Alert will not Fire.
Action set Name: Enter Action Set Name. In our Test Alert we enter Action set Name “EMAIl”.
Output Tab: Output tab Contain List of Output Variable defoen in select Statement as shown in Window
1.4.Note that if you Output tab is Blank Requery the Alert then it will show output Variable.
Procedure of design of Event Alert is same as Periodic Alert.Just you Have to choose
Event Tab and give Event Details. Application Name and Table Name and Click on Check box “After Insert” and “
After Update” according to Requirment and rest of Procedure is same.
Practical Probem and Solution During Design Event Alerts:
We have to Design “Item Attribute Update” in Toshiba, Sydney Projects.Requirment of Alert is that if any item
Comes in Inventory Email should sent to MIS USER. We developed Event Alerts. But when we are inserting new
record in MTL_SYSTEM_ITEMS_B our Alert is Not Fired.
GO TO Alert Details and in Alert Details Forms Click on Installation Tab and give the name of Operating Units for
which You Want to Design Alerts.
SELECT :ROWID,
segment1,
organization_id,
inventory_item_id
into
&rowid,
&segment1,
&organization_id,
&inventory_item_id
from mtl_system_items_b
where rowid= :ROWID
Query Periodic Alert with time interval:
select
rsh.receipt_num, msi.segment1, rsl.quantity_shipped, sum(rcv.QUANTITY),
decode(msi.organization_id,184,
'RBatra@toshiba-tap.com jdunnicliff@toshiba-tap.com dmorris@toshiba-tap.com nhirapetians@toshiba-tap.com',
195,'wzarb@Toshiba-Tap.com pbarker@Toshiba-Tap.com kwaterstone@Toshiba-Tap.com smarffy@toshiba-
tap.com')
INTO
&RECEIPT_NUM,
&SEGMENT1,
&QUANTITY_SHIPPED,
&QUANTITY_RECEIVED,
&TO_RCP
from
mtl_system_items msi,
rcv_shipment_lines rsl,
RCV_TRANSACTIONS rcv,
rcv_shipment_headers rsh
where
trunc(rsh.creation_date) > '01-jan-90'
and rsh.SHIPMENT_HEADER_ID =rcv.SHIPMENT_HEADER_ID
and rsl.shipment_header_id = rsh.shipment_header_id
and rsl.SHIPMENT_LINE_ID =rcv.SHIPMENT_LINE_ID
and rcv.TRANSACTION_TYPE ='DELIVER'
and msi.organization_id = rsl.to_organization_id
and msi.inventory_item_id = rsl.item_id
and msi.organization_id in(184,195)
and rcv.quantity >0
and rcv.last_update_date >=
to_date(:DATE_LAST_CHECKED, 'DD-MON-YYYY HH24:MI:SS') - (30/(24*60*60))
group by rsh.receipt_num, msi.segment1, rsl.quantity_shipped,msi.organization_id
l_serial_control_code NUMBER:=NULL;
BEGIN
IF p_organization_id IN (195, 200, 184, 192) THEN
SELECT msib.serial_number_control_code
INTO l_serial_control_code
FROM mtl_system_items_b msib,
mtl_parameters mp
WHERE msib.inventory_item_id = p_inventory_item_id
AND msib.organization_id = mp.master_organization_id
AND mp.organization_id = p_organization_id;
IF l_serial_control_code <> 1 THEN
UPDATE mtl_system_items_b
SET serial_number_control_code = 6
WHERE organization_id = p_organization_id
AND inventory_item_id = p_inventory_item_id;
END IF;
ELSE
NULL;
END IF;
IF p_organization_id IN (195, 200, 184, 187, 189, 188, 190, 192) THEN
UPDATE mtl_system_items_b msib
SET msib.atp_flag = 'Y'
WHERE msib.organization_id = p_organization_id
AND msib.inventory_item_id = p_inventory_item_id;
ELSE
NULL;
END IF;
EXCEPTION
WHEN OTHERS THEN
fnd_file.put_line(fnd_file.log,'Process Failed:');
--NULL;
END update_row;
END;
/
Alerts simply to notify one person/multiple persons about an event or some data change.Alerts are of
two types.
Event Based Alerts : These Alerts are fired/triggered based on some change in data in the
database.
Ex: If u want to notify your manager when you create an item in the inventory you can use event
based alerts. When you create an item in the inventory it will cretae a new record in
mtl_system_items_b, here inserting a record in the table is an event so when ever a new record is
inserted it will send the alert.In same alert you can also send the information related to that
particular item.
Periodic Alerts : These Alerts are triggered hourly,daily, weekly, monthly or yearly based on
your input.
Ex: If you want to know list of items created on that day at the end of day you can use periodic
alerts repeating periodically by single day.This alert is not based on any chages to database.this
alert will notify you everyday regardless of data exists or not that means even if no items are
created you wil get a blank notification.
1.Study your Business requirement and decide what type of alert you need either periodic alert or
event based alert.
2. If you are going for periodic alert decide the frequency.
3. If you have chosen event based alert then find out on whst event(insert,update,delete) you
want to fire the alert.
4. Decide what data need to be included in the alert.
5. Based on the data you want in the alert write a SELECT SQL statement to pull the data.
6. Create a distribution list grouping all the people to whom you want to send the alert.
Screen Shots :
FNDLOAD: ….exporting Oracle Alert
1. Command to download
Usage
2. Command to upload
Usage