i want to run test procedure on 5.0 pm every day.this procedure is not running properly.
any procedure is in dbms_job package to disable and enable the job.
jobs_queue_intervals parameter is must?without this parameter job can work?declare
new_job number;
begin
dbms_job.submit(new_job, 'test2;',to_date('10-jun-2003 5:00:00','dd-mon-yyyy hh24:mi:ss'),'SYSDATE + 17/24', FALSE);
dbms_output.put_line('Job: '||to_char(new_job));
end; assume we are talking about Oracle 8i:
The "job_queue_interval" parameter is not a must -- it will default to 60 seconds when omitted.
There is no direct way to just "disable" a job temporarily. The nearest thing is to it "BROKEN", which will change its NEXT_DATE to 01-01-4000 and effectively disable the job. When you want to enable it, however, you should set the next execution date explicitly. Examples:
to disable a job:
execute DBMS_Job.Broken(<job_id>, true)
commit;
to enable a job:
execute DBMS_Job.Brocken(<job_id>, false, <next date>)
commit;Comments to your code:
The code submits a job which calls a procedure named 'test2' in current user's schema. The job will be executed for the first time at 5:00am on June 10, and at 17-hour intervals afterward. If you want it executed at 5:00pm every day, your INTERVAL should be 'trunc(sysdate+1)+17/24'.
You also must commit after submitting the job for things to start happening.HTH
Flado
Comment from SDutta Date: 06/10/2003 02:18PM PDT
To schedule jobs using DBMS_JOB, you first need to set the parameters JOB_QUEUE_PROCESSES and JOB_QUEUE_INTERVAL in your init.ora file. They should be non-zero values. JOB_QUEUE_INTERVAL if not defined defaults to 60 (seconds) this parameter is obsolete in 9i. JOB_QUEUE_PROCESSES is the number of internal background processes that will process your job.
any procedure is in dbms_job package to disable and enable the job.
jobs_queue_intervals parameter is must?without this parameter job can work?declare
new_job number;
begin
dbms_job.submit(new_job, 'test2;',to_date('10-jun-2003 5:00:00','dd-mon-yyyy hh24:mi:ss'),'SYSDATE + 17/24', FALSE);
dbms_output.put_line('Job: '||to_char(new_job));
end; assume we are talking about Oracle 8i:
The "job_queue_interval" parameter is not a must -- it will default to 60 seconds when omitted.
There is no direct way to just "disable" a job temporarily. The nearest thing is to it "BROKEN", which will change its NEXT_DATE to 01-01-4000 and effectively disable the job. When you want to enable it, however, you should set the next execution date explicitly. Examples:
to disable a job:
execute DBMS_Job.Broken(<job_id>, true)
commit;
to enable a job:
execute DBMS_Job.Brocken(<job_id>, false, <next date>)
commit;Comments to your code:
The code submits a job which calls a procedure named 'test2' in current user's schema. The job will be executed for the first time at 5:00am on June 10, and at 17-hour intervals afterward. If you want it executed at 5:00pm every day, your INTERVAL should be 'trunc(sysdate+1)+17/24'.
You also must commit after submitting the job for things to start happening.HTH
Flado
Comment from SDutta Date: 06/10/2003 02:18PM PDT
To schedule jobs using DBMS_JOB, you first need to set the parameters JOB_QUEUE_PROCESSES and JOB_QUEUE_INTERVAL in your init.ora file. They should be non-zero values. JOB_QUEUE_INTERVAL if not defined defaults to 60 (seconds) this parameter is obsolete in 9i. JOB_QUEUE_PROCESSES is the number of internal background processes that will process your job.
解决方案 »
- ***********碎片问题,大家来看看**********
- 求一个简单的SQL语句
- oracle错误删除的记录如何恢复?
- 今天告别单身,庆祝一下~!
- oem的表编辑器中,在自由SQL模式下,如何连续执行两条insert语句?
- ~~~~~~问题紧急,请大家务必帮小弟一把!~~~~~~~~~~~在线等!
- 请问Oracle安装完毕后,需要如何配置才能使用intermedia Text
- 来鸟问题--在win2000 sever下无法安装oracle 9i(100分--在线)
- 请问 ORACLE8 中审计功能的使用方法, 谢谢
- 关于svrmgr30命令的问题
- 我装完Oracle8i后,OracleOraHome81TNSListener服务启动不起来.
- ===================SQL语句简单问题=======================
jobno number;
begin
dbms_job.submit(jobno,'datepro;',sysdate,'trunc(sysdate)+1');
commit;
end;
/