找回密码
 立即注册
搜索
查看: 330|回复: 0

[Oracle] Oracle数据库创建定时任务执行语句

[复制链接]

20

主题

2

回帖

214748万

积分

新手上路

积分
2147483647

最佳新人活跃会员热心会员推广达人宣传达人灌水之王突出贡献优秀版主荣誉管理论坛元老

发表于 2025-1-29 12:05:13 | 显示全部楼层 |阅读模式
Oracle数据库创建定时任务执行语句//注释:时间为每日的凌晨1点,执行一遍即可,预防创建多个,请不要连续点击执行;

  1. declare
  2. jobno number;
  3. begin
  4. dbms_job.submit(
  5. job => jobno,
  6. what => 'delete from pdss.rule_interaction_effect
  7.    where (drug_code1,drug_name1,drug_code2,drug_name2) in
  8.          (select drug_code1,drug_name1,drug_code2,drug_name2
  9.             from pdss.rule_interaction_effect
  10.            group by drug_code1,drug_name1,drug_code2,drug_name2
  11.           having count(*) > 1)
  12.      and id not in (select min(id)
  13.                          from pdss.rule_interaction_effect
  14.                         group by drug_code1,drug_name1,drug_code2,drug_name2
  15.                        having count(*) > 1);',
  16. next_date => sysdate,
  17. interval => 'trunc(sysdate+1)+(1*60)/(24*60)');
  18. commit;
  19. end;
复制代码


欢迎注册吾爱缘分网网站,别人有的咱都有哦。
高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

手机版|小黑屋|技术分享

GMT+8, 2025-5-10 04:33 , Processed in 0.051553 second(s), 19 queries .

Powered by 吾爱缘分

© 2024-2024 吾爱缘分

快速回复 返回顶部 返回列表