易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle 10g schedule job的常用操作

Oracle数据库10g schedule job的常用操作:
-- job 权限
grant create job to somebody;
-- job 创建
begin
dbms_scheduler.create_job (
job_name => 'AGENT_LIQUIDATION_JOB',
job_type => 'STORED_PROCEDURE',
job_action => 'AGENT_LIQUIDATION.LIQUIDATION', --存储过程名
start_date => sysdate,
repeat_interval => 'FREQ=MONTHLY; INTERVAL=1; BYMONTHDAY=1;BYHOUR=1;BYMINUTE=0;BYSECOND=0', -- 按月,间隔为1个(月),每月1号,凌晨1点
comments => '执行代理商清分程序'
);
end;
/
-- job 执行时间测试
DECLARE
start_date date;
return_date_after date;
next_run_date date;
BEGIN
start_date := sysdate;--to_timestamp_tz('10-OCT-2004 10:00:00','DD-MM-YYYY HH24:MI:SS');
return_date_after := start_date;
FOR i IN 1..10 LOOP
DBMS_SCHEDULER.EVALUATE_CALENDAR_STRING('FREQ=MONTHLY; INTERVAL=1; BYMONTHDAY=1;BYHOUR=1;BYMINUTE=0;BYSECOND=0',start_date, return_date_after, next_run_date);
DBMS_OUTPUT.PUT_LINE('next_run_date: ' || to_char(next_run_date,'yyyy-mm-dd HH24:MI:SS'));
return_date_after := next_run_date;
END LOOP;
END;
/
-- job 查询
select owner, job_name, state from dba_scheduler_jobs;
select job_name, state from user_scheduler_jobs;
-- job 启用
begin
dbms_scheduler.enable('BACKUP_JOB');
end;
/
-- job 运行
begin
dbms_scheduler.run_job('COLA_JOB',TRUE); -- true代表同步执行
end;
/
-- job 停止(不太好用)
begin
dbms_scheduler.stop_job(job_name => 'COLA_JOB',force => TRUE);
end;
/
-- job 删除(对停job来说好用)
begin
dbms_scheduler.drop_job(job_name => 'COLA_JOB',force => TRUE);)
end;
/


相关文档:

Oracle Finalizes Acquisition of Sun


We are pleased to announce that Oracle has completed its acquisition of Sun Microsystems and Sun is now a wholly owned subsidiary of Oracle. With this news, we want to reiterate our commitment to deliver complete, open and integrated systems that help our customers improve the performance, reliabi ......

oracle日期函数集锦

一、 常用日期数据格式
1.Y或YY或YYY 年的最后一位,两位或三位
SQL> Select to_char(sysdate,'Y') from dual;
TO_CHAR(SYSDATE,'Y')
--------------------
7
SQL> Select to_char(sysdate,'YY') from dual;
TO_CHAR(SYSDATE,'YY')
---------------------
07
SQL> Select to_char(sysdate,'YYY') from d ......

LEI 连接ORACLE 版本问题

Can you connect to an Oracle database with a 64-bit Oracle client?
 Technote (FAQ)
 
 
 
Question
You are unable to connect to an Oracle database with a 64-bit Oracle client. Does Lotus Enterprise Integrator (LEI), Lotus Domino Enterprise Connection Services (DECS), or LSX ......

转:Oracle系统非空闲等待事件

select sid,
       p1,
       p1raw,
       p2,
       p2raw,
       p3,
       p3raw,
    &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号