This content has been marked as final. Show 1 reply
I would do this in two steps.
- write a plsql procedure which sends the snmp trap
- create a second job which is event-based and runs when the first job has failed and calls the plsql procedure to send the snmp trap. Sample code to do this is below.
Hope this helps,
Code to run one job when another (called first_job) has failed. Run this code as the user owning the job.
exec dbms_scheduler.set_attribute ( 'first_job' , 'raise_events' , dbms_scheduler.job_failed);
'tab.user_data.object_name = ''FIRST_JOB''',
-- this allows multiple simultaneous runs of the second job on 11g and up
$IF DBMS_DB_VERSION.VER_LE_10 $THEN