Oracle job alert for DBMS job - oracle

I am trying to create an alert for a dbms scheduler job if it is running for a duration longer than expected. For example, if a job that usually takes 2 hours to run is now running for more than 2.5 hours, I want to be notified.
What would be the best way to do this? Can I use Oracle Enterprise Manager for this?

I achieved this by setting the parameter max_run_duration in the dbms job.
An event will be raised if the job run time exceeds the time mentioned in the property.

Related

Deployed application on Heroku executes automatically

I am using Advanced Scheduler to schedule a cron job daily once at 12 PM. But the code executes automatically even though I have disabled the trigger and disconnected my GitHub repository. So far the code has executed three times in an interval of 2 hours.
I don't understand why it is executing automatically?
Any idea?

Change Load Plan execution time but nothing happens is Oracle ODI

I want to change the execution time of a load plan in Oracle ODI Scheduling. I change Starting date and times manually but it is again executed in previous date and time settings. How can i be able to execute the load plans in required date and time? Thanks
EDITING VERSION 1:
The Images are
P.S.: We have also converted to "Active for the period" and didn't work. Is it related with the Java version?
Changing the schedules of a Load Plan or a Scenario will update the schedule information in the repository but will not update that information in the agent.
There is therefore an extra step to perform. On the topology tab, a right click on the physical agent will give the option Update Schedule. That will refresh the agent memory with the schedule stored into the repository.

Job failed only on scheduler

I'm using infosphere DataStage of IBM for loading data in ETL processes.
I have some problem with one of my jobs.
This job scheduler twice a month, and when it run automatic by the tool - it get an oracle error:
ORA-00813 : object no longer exists
But when we run it manualy after it failed - there is no error at all and it's finished fine.
I tried to run the query in oracle directly and it just fine.
That problem happend twice, and always after the failure - it run good with manual execution.
any idea?
Thanks.

When an Oracle Scheduled Job is Enabled, is it run in separate session?

I've recently been learning to use Oracle's scheduler to run jobs asynchronously.
I'm trying to build jobs that only run once and then are automatically dropped.
The way I've accomplished this is to set the MAX_RUNS attribute of a job to 1 and for the AUTO_DROP attribute to be set to TRUE.
All my jobs are DISABLED by default as I only kick them off manually.
I noticed that the jobs were not being dropped and this Ask Tom thread explained why.
Thus I must enable my jobs first before running them if they are to be dropped automatically.
However when a job is enabled it is scheduled immediately.
My question is:
When a scheduled job is enabled, and thus immediately scheduled, does it execute in a separate session?
I am needing the jobs to all be scheduled asynchronously and thus I am hoping to achieve the same behavior as:
DBMS_SCHEDULER.RUN_JOB(V_JOB_NAME, FALSE);
FALSE indicating asynchronous scheduling of the job in a separate session.
I am fine with the approach of enabling a job and having it immediately scheduled, as long as it's asynchronous in a separate session.
Alternatively, if there was a way to enforce that a job is NOT scheduled when it is enabled, that would work as well.
I am currently on Oracle 11gR2
If I had a bunch of asynchronous 1-time jobs that needed to be run, I would seriously consider using the old dbms_job package to do my scheduling rather than dbms_scheduler. Then you're just doing something like this
declare
l_jobno pls_integer;
begin
dbms_job.submit( l_jobno,
'<<what you want the job to do>>',
sysdate );
end;
/
This will cause a new session to be opened as soon as you commit the submit that runs whatever code you specified. It'll run once and then get removed from dba_jobs.
Alternatively, I'd try to re-architect the system so that there is a background "widget processor" job that runs every few minutes, reads a table to determine what widgets need to be processed, and processes those widgets. That probably makes more sense than spawning a separate job to process each widget.
dbms_scheduler is wonderful when you want to have more sophisticated processing where one job depends on another and jobs get started based on events. But old-school dba_jobs can be really handy when you just need a very lightweight framework for very simple jobs.
I have found that by setting the START_DATE of a new job to a future date and the REPEAT_INTERVAL to something like 'FREQ=YEARLY' then the job will not run immediately when it is enabled.
While not ideal, this will allow for the job to be dropped when run manually via the DBMS_SCEHDULER.RUN_JOB(V_JOB_NAME, FALSE); command.
However this does imply that the job is scheduled to run at some point in the future. So just don't forget to run it manually. That's fine in my case since everything is happening in a single call, but good to call out.

Oracle scheduler job sometimes failing, without error message

I have created a dbms scheduler job which should write a short string to the alert log of each instance of the 9 databases on our 2-node 11g Oracle RAC cluster, once every 24 hours.
The job action is:
'dbms_system.ksdwrt(2, to_char(sysdate+1,''rrrr-mm-dd'') || ''_First'');'
which should write a line like:
2014-08-27_First
The job runs succesfully according to its log, and it does write what it's supposed to, but not always. It's only been scheduled for a few days, so I can't be certain, but it looks as if it will only write to one instance's alert log. Logs on both sides seem to be getting written to, but if it's on one side it's not on the other, so it appears. There is however no indication whatever of any failure in the job itself.
Can anyone shed any light on this behaviour? Thanks.

Resources