title: Create oracle scheduler job which runs daily
body: <p>I want to create oracle scheduler job which runs daily at <code>20:00</code> and runs for 30 minute. This job will delete the rows from <code>KPI_LOGS</code> table as this table contains large amount of data and it continues to grow. I have created the below script in oracle sql developer for such job but not sure if this is correct or not as i am new to scheduler job concept.</p>
  
  <pre><code>    BEGIN
          DBMS_SCHEDULER.CREATE_JOB (
                  job_name =&gt; '"RATOR_MONITORING"."CROP_KPI_LOGS"',
                  job_type =&gt; 'PLSQL_BLOCK',
                  job_action =&gt; 'DELETE FROM KPI_LOGS WHERE CAST(TIMESTAMP AS DATE) &lt; (SYSDATE  - 28);',
                  number_of_arguments =&gt; 0,
                  start_date =&gt; NULL,
                  repeat_interval =&gt; 'FREQ=DAILY;INTERVAL=30',
                  end_date =&gt; NULL,
                  enabled =&gt; FALSE,
                  auto_drop =&gt; FALSE,
                  comments =&gt; 'CROP_KPI_LOGS');    
  
          DBMS_SCHEDULER.SET_ATTRIBUTE( 
                   name =&gt; '"RATOR_MONITORING"."CROP_KPI_LOGS"', 
                   attribute =&gt; 'logging_level', value =&gt; DBMS_SCHEDULER.LOGGING_OFF);
  
  
  
      DBMS_SCHEDULER.enable(
               name =&gt; '"RATOR_MONITORING"."CROP_KPI_LOGS"');
  END;
  </code></pre>