develog

[Oracle] DBMS_JOB 본문

DB/Oracle

[Oracle] DBMS_JOB

냐옴 2016. 9. 20. 11:35

▶DBMS_JOB

http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_job.htm#BABHCBFD


▶DBMS_JOB Subprograms

Subprogram Description
BROKEN Procedure Disables job execution
CHANGE Procedure Alters any of the user-definable parameters associated with a job
INSTANCE Procedure Assigns a job to be run by a instance
INTERVAL Procedure Alters the interval between executions for a specified job
NEXT_DATE Procedure Alters the next execution time for a specified job
REMOVE Procedure Removes specified job from the job queue
RUN Procedure Forces a specified job to run
SUBMIT Procedure Submits a new job to the job queue
USER_EXPORT Procedures Re-creates a given job for export, or re-creates a given job for export with instance affinity
WHAT Procedure Alters the job description for a specified job


▶Job 생성

DECLARE

    X NUMBER;

BEGIN

    DBMS_JOB.SUBMIT

    (

          JOB       => X

        , WHAT      => 'UAIMS.AATEST_PR;' --세미콜론 필수

        , NEXT_DATE => SYSDATE + (1 / 24 / 60)

        , INTERVAL  => 'SYSDATE + (1 / 24 / 60)'

        , NO_PARSE  => FALSE

    );

    COMMIT;

    DBMS_OUTPUT.PUT_LINE('JOB NUMBER IS: ' || TO_CHAR(X));

END;


▶Job 삭제

DECLARE

BEGIN

    DBMS_JOB.REMOVE(123);

    COMMIT;

END;


▶Job 수동실행

DECLARE

BEGIN

    DBMS_JOB.RUN(123);

END;


▶Job 비활성

DECLARE

BEGIN

    DBMS_JOB.BROKEN(123, TRUE);

    COMMIT;

END;


▶Job 활성

DECLARE

BEGIN

    DBMS_JOB.BROKEN(123, FALSE);

    COMMIT;

END;


▶등록된 Job 조회

SELECT * 

FROM USER_JOBS;


'DB > Oracle' 카테고리의 다른 글

[Oracle] SQLGate 엑셀 데이터 import  (0) 2016.10.14
[Oracle] charset  (0) 2016.09.21
[Oracle] Bind vs. Substitution variables  (0) 2016.09.13
[Oracle] tnsnames.ora  (0) 2016.09.13
[Oracle] DBMS_JOB, DBMS_SCHEDULER  (0) 2016.09.06
Comments