/* 배치로 돌릴 프로시저 이므로 당연히 IN 변수가 없다 */
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT (
JOB => X
,WHAT => '
declare
v_result varchar2(1000);
v_err_code number;
v_err_mgs varchar2(1000);
begin
패키지명.프로시저명(v_result, v_err_code, v_err_mgs);
endl;'
,NEXT_DATE => SYSDATE + 1/24/60 -- 1분 후 부터 시작
,INTERVAL => 'TRUNC(SYSDATE)+1+1/24'
,NO_PARSE => TRUE
);
END;
/* 생성 확인 */
SELECT * FROM USER_JOBS;
/* 강제 실행 */
BEGIN
DBMS_JOB.JUN('JOB번호');
COMMIT;
END;
/* 1분단위로 테스트 */
BEGIN
DBMS_JOB.INTERVAL('JOB번호', 'TRUNC(SYSDATE) + 1 +1/24)');
END;
/* 시간확인 */
SELECT
SYSDATE
,SYSDATE + 1/24/60/10 AS SEC6
,SYSDATE + 1/24/60/4 AS SEC15
,SYSDATE + 1/24/60 AS MIN1
,SYSDATE + 1/24/12 AS MIN5
,SYSDATE + 1/24 AS HH1
,TRUNC(SYSDATE) + 1 + 1/24 AS AM01
FROM DUAL;
반응형