Oracle 定时事件

-- 监控数量
select count(1) from CT_LOGVIEW;

DELETE FROM CT_LOGVIEW WHERE TRANSACTIONID = ''
-- 添加定时事件
BEGIN
  DBMS_SCHEDULER.CREATE_JOB (
    job_name        => 'DeleteErrorDataJob',
    job_type        => 'PLSQL_BLOCK',
    job_action      => 'BEGIN DELETE FROM CT_LOGVIEW WHERE TRANSACTIONID = ''20220527075943677000''; END;',
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
    end_date        => NULL,
    enabled         => TRUE,
    comments        => 'Job to delete data every 1 minutes'
  );
END;
/

-- 删除事件
BEGIN
  DBMS_SCHEDULER.DROP_JOB (
    job_name => 'DeleteErrorDataJob',
    force => TRUE
  );
END;
/

你可能感兴趣的:(java,数据库,服务器)