zoukankan      html  css  js  c++  java
  • oracle定时任务

    oracle定时任务

    1.创建根据日期删除的过程,
    create or replace procedure teacherjob is
    begin   
    delete from zftal_mobilehd_txrzb where txsj like  (select 
    to_char(add_months(sysdate,-1),'yyyymm%') from dual);
    delete from zftal_mobilehd_hdwtxqb where hdsj like  (select 
    to_char(add_months(sysdate,-1),'yyyymm%') from dual);
    end;
    2.新建定时任务并提交(参考网址:[https://www.cnblogs.com/yx007/p/6519544.html]
    (https://www.cnblogs.com/yx007/p/6519544.html)
    user_jobs表结构
    字段(列) 类型 描述
    job number 任务的唯一标示号
    log_user varchar2(30) 提交任务的用户
    priv_user varchar2(30) 赋予任务权限的用户
    schema_user varchar2(30) 对任务作语法分析的用户模式
    last_date date 最后一次成功运行任务的时间
    last_sec varchar2(8) 如hh24:mm:ss格式的last_date日期的小时,分钟和秒
    this_date date 正在运行任务的开始时间,如果没有运行任务则为null
    this_sec varchar2(8) 如hh24:mm:ss格式的this_date日期的小时,分钟和秒
    next_date date 下一次定时运行任务的时间
    )
    TRUNC(LAST_DAY(SYSDATE))+15+14.2/24
    每个月的15号14.2时执行
    

    3.查看定时任务执行时间和日期:SELECT * FROM dba_jobs;
    4.跟踪任务的情况(查看任务队列):select job, next_date, next_sec, failures, broken from user_jobs;
    

  • 相关阅读:
    CG_Lession
    linux学习网站大全[转]
    C++ books
    Linux 建议学习路径[转]
    talking C++ STL
    Factory
    计算机图像图形学相关好书推荐
    ASP.NET控件缩写大全
    web开发面试题一
    ASP.Net面试题之二
  • 原文地址:https://www.cnblogs.com/khtt/p/15238849.html
Copyright © 2011-2022 走看看