zoukankan      html  css  js  c++  java
  • oracle定时器

    /* 每10秒钟执行一次 插入一条时间 */ 
    -- 创建table
    create table tab_time(       
           current_time timestamp      
    ); 
    
    -- 创建存储过程
    create or replace procedure pro_job_print
    as   
    begin       
      --dbms_output.put_line('系统时间:' || to_char(sysdate, 'dd-mm-yyyy hh24:mi:ss'));       
      insert into tab_time values(sysdate);   
      end;   
      
    -- 调用过程测试  
    begin   
      pro_job_print;   
     end;  
     
     --select 24 * 60 * 60 from dual;    
    -- 创建job
    declare         
       job1 number;
    begin   
      dbms_job.submit(job1, 'pro_job_print;', sysdate, 'sysdate+10/86400');--每10插入一条记录
      end;
      
    --相关视图
    select * from dba_jobs;
    select * from all_jobs;
    select * from user_jobs;
    -- 正在运行job
    select * from dba_jobs_running; 
    
    -- 运行job
    begin   
      dbms_job.run(5);--和select * from user_jobs; 中的job值对应,看what对应的过程
      end;  
    
    -- 查询是否插入数据
    select to_char(current_time, 'dd-mm-yyyy hh24:mi:ss') current_time from tab_time order by current_time; 
    
    -- 删除一个job
    begin   
      dbms_job.remove(6);--和select * from user_jobs; 中的job值对应,看what对应的过程
      end;
    
    begin
    show parameter job_queue_process;
    end;
    
    select job, next_date, next_sec, failures, broken from user_jobs;
  • 相关阅读:
    捕获组
    re.S解析
    Python eval 函数妙用
    Python tips: 什么是*args和**kwargs?
    HBase 的安装与配置
    HBase 基本操作
    HBase中的备份和故障恢复方法
    Hbase写数据,存数据,读数据的详细过程
    HBase shell
    HDFS的快照原理和Hbase基于快照的表修复
  • 原文地址:https://www.cnblogs.com/qinzhengquan/p/6047431.html
Copyright © 2011-2022 走看看