gpt4 book ai didi

oracle10g - 如何在 oracle 10g 中调度程序?

转载 作者:行者123 更新时间:2023-12-02 03:52:32 24 4
gpt4 key购买 nike

我必须在 oracle 10g 中安排一个存储过程?

假设

create table t1(name varchar2(10));
insert into t1 values('hi');

create or replace procedure insertname
as
begin
insert into t1 values('hi');
end;

现在我的要求是每天上午 11 点我的程序必须自动执行。

我该如何实现它。

实际上我研究了 dbms_scheduler.create_job。但我无法实现它,任何人都可以解释我如何安排我的存储过程。

提前致谢

最佳答案

看这里: http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_sched.htm

或者更好的例子: http://www.apex-at-work.com/2009/06/dbmsscheduler-examples.html

你感兴趣的部分(只需更改 job_action)

dbms_scheduler.create_job (  
job_name => 'TEST_JOB',
job_type => 'PLSQL_BLOCK',
job_action => 'begin /* some process code */ commit; end;',
number_of_arguments => 0,
start_date => sysdate +1/24/59, -- sysdate + 1 minute
job_class => 'ADMIN', -- Priority Group
enabled => TRUE,
auto_drop => TRUE,
comments => 'Testrun');

关于oracle10g - 如何在 oracle 10g 中调度程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13833955/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com