SQL Language (MOSC)

MOSC Banner

Scheduling a job using dbms_job.submit

edited Oct 11, 2013 12:23AM in SQL Language (MOSC) 6 commentsAnswered ✓
Hi,I would like to create a job, using dbms_job.submit, that runs :
From Monday to Friday
Every hour
From 3am to 6pm
Starting the next hour following the job creating

Could you please give me the code ?

The following code doesn't work :

DECLARE jobno number;
begin
dbms_job.submit(
jobno,
'statspack.snap(i_snap_level => 5);',
sysdate+1/24,
'trunc(least(next_day(SYSDATE,''LUNDI''),
next_day(SYSDATE,''MARDI''),
next_day(SYSDATE,''MERCREDI''),
next_day(SYSDATE,''JEUDI''),
next_day(SYSDATE,''VENDREDI''))+1/24,'HH')');
commit ;
end ;

Rgds,

Frederic

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center