Hi,
I am so confused on this request from a user. They have a Bash Script running but it it sends an alert to them even if the SQL query returns nothing. So they want to use NPM instead. So I am trying to figure this out and boy am I confused.
The alert they want it be is something like this:
ALERT: OSM long running or poison order found!
He sent me the script they use but in a discussion they say forget the script they need 2 sql queries ran and an email sent if the query returns something.
Here is one of the scripts:
select ooh.order_seq_id, oh.reference_number, ot.task_mnemonic, oh.ord_state_id, os.mnemonic, oh.ord_creation_date,
count(*) from om_hist$order_header ooh, om_task ot, om_order_header oh, om_ospolicy_state os,OM_ORDER_FLOW oof1
where ooh.task_id = ot.task_id and
ooh.order_seq_id = oh.order_seq_id and
oh.order_seq_id = oof1.order_seq_id and
oof1.task_id = ot.task_id and
oh.ord_state_id = os.id and
os.id in ( 4, 5) and
trunc(ooh.timestamp_in) = trunc(sysdate)
group by ooh.order_seq_id, ot.task_mnemonic, oh.ord_state_id, oh.ord_creation_date, oh.reference_number, os.mnemonic having count(*) > 250 order by count(*) desc
the other is:
select order_seq_id,count(order_seq_id) from (select order_seq_id from om_order_amendment oa
where oa.skipped_amending = 'N' and
oa.compensation_completion_date is null and
oa.compensation_start_date is null )
group by order_seq_id having count (*) > 1
Anyone have any ideas?????