sql >> Database teknologi >  >> RDS >> Oracle

Opretter DBMS_SCHEDULER job til oracle

Jeg er den 12.1.0.1.0. Du kan oprette jobbet i en simpel anonym blok :

SQL> BEGIN
  2    DBMS_SCHEDULER.DROP_JOB (JOB_NAME => 'test_full_job_definition');
  3  END;
  4  /

PL/SQL procedure successfully completed.

SQL>
SQL> BEGIN
  2    DBMS_SCHEDULER.create_job (
  3      job_name        => 'test_full_job_definition',
  4      job_type        => 'PLSQL_BLOCK',
  5      job_action      => 'BEGIN my_job_procedure; END;',
  6      start_date      => SYSTIMESTAMP,
  7      repeat_interval => 'freq=hourly; byminute=0; bysecond=0;',
  8      end_date        => NULL,
  9      enabled         => TRUE,
 10      comments        => 'Job defined entirely by the CREATE JOB procedure.');
 11  END;
 12  /

PL/SQL procedure successfully completed.

SQL>
SQL> SELECT JOB_NAME, ENABLED FROM DBA_SCHEDULER_JOBS where job_name ='TEST_FULL_JOB_DEFINITION'
  2  /

JOB_NAME                                 ENABL
---------------------------------------- -----
TEST_FULL_JOB_DEFINITION                 TRUE

SQL>

Flere eksempler her




  1. Beregn alderen i år i PostgreSQL

  2. Sådan fremskyndes indsættelse fra pandas.DataFrame .to_sql

  3. Deltag selv i orakel med eksempler

  4. Installer Oracle Instant-klient i Docker-container til Python cx_Oracle