Linux论坛's Archiver

《开源》旗舰电子杂志2008年11期发布,火热下载中!

haitao_581 发表于 2008-2-15 11:06

自动执行

最近一直在玩java,很少玩数据库了,最近只弄了个小的自动执行的sql,我发上来,大家可以看看,

连接到:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production

SQL> variable job1 number ;
SQL> begin
  2  dbms_job.submit(:job1,'Auto_ExecSUM;',sysdate,'sysdate+240/1440');
  3  end;
  4  /

PL/SQL 过程已成功完成。

SQL> begin
  2  dbms_job.run(:job1);
  3  end;
  4  /

PL/SQL 过程已成功完成。

SQL>  select job,next_date,next_sec,failures,broken from user_jobs;

       JOB NEXT_DATE  NEXT_SEC           FAILURES B
---------- ---------- ---------------- ---------- -
         1 09-8月 -07 19:23:01                  0 N

SQL>  select job,next_date,next_sec,failures,broken from user_jobs;

       JOB NEXT_DATE  NEXT_SEC           FAILURES B
---------- ---------- ---------------- ---------- -
         1 09-8月 -07 19:23:01                  0 N

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.