sql - Add job to scheduler to invoke that job automatically everyday -
i have created job runs on everyday @ 09:00:00.
below snippet have used create job :
begin dbms_scheduler.create_job( job_name => 'proecss_state_arch' ,job_type => 'stored_procedure' ,job_action => 'test' -- procedure name ,start_date => sysdate 9:00:00 ,repeat_interval => 'freq=daily' ,enabled => true ,comments => 'job schedule archiving process_state'); end;
sole purpose of run stored procedure 'test' on everyday @ 09:00:00
how add job scheduler invoke job automatically on everyday? can please tell me ??
you need specify byhour
run job everyday @ 9 pm.
begin dbms_scheduler.create_job( job_name => 'proecss_state_arch' ,job_type => 'stored_procedure' ,job_action => 'test' -- procedure name ,start_date => sysdate ,repeat_interval => 'freq=daily; byhour=9' --added byhour ,enabled => true ,comments => 'job schedule archiving process_state'); end; /
to run on scheme, need create job
privilege. otherwise need run on other privileged user. in case specify job_action as,
job_action => '<schema_name>.test'
to edit job, have set_attribute procedure in dbms_scheduler package.
eg:-
begin dbms_scheduler.set_attribute ( name => 'proecss_state_arch', attribute => 'repeat_interval', value => 'freq=daily; byhour=10' --everyday 10 am. ); end;
Comments
Post a Comment