job_set_ndxsys.sql - will setup the package as job 12 at 21:00 hours today

SET echo off;
 
clear screen;
 
PROMPT
 
PROMPT COLLECTING USER INFORMATION
PROMPT
 
ACCEPT database_sid   CHAR PROMPT 'DATABASE TO CONNECT TO    [ORCL]: ' DEFAULT ORCL
ACCEPT mhsys_password CHAR PROMPT 'PASSWORD FOR USER MHSYS  [MHSYS]: ' DEFAULT MHSYS HIDE
PROMPT
 
 
prompt  CONNECTING USER MHSYS
CONNECT MHSYS/&mhsys_password@&database_sid;
 
SET serveroutput ON;
SET linesize 100;
spool job_set_ndxsys.LOG;
 
 
prompt SHOWING JOBS
SELECT JOB, SCHEMA_USER,
       TO_CHAR(NEXT_DATE, 'DD-MON-YYYY, HH24:MI') NEXT_DATE,
       INTERVAL, WHAT
FROM dba_jobs
 
 
ORDER BY job;
 
 
prompt DELETING JOBS
DELETE FROM DBA_JOBS
WHERE job IN (12);
COMMIT;
 
 
prompt  CREATING JOBS
BEGIN
DBMS_JOB.ISUBMIT
          (job       => 12,
           what      => 'PKG_NDXSYS.P_MAIN;',
           next_date => TRUNC(SYSDATE) + 19/24 + 00/1440,
           INTERVAL  => 'sysdate + 1',
           no_parse  => FALSE);
COMMIT;
END;
/
 
 
prompt SHOWING JOBS
SELECT name DATABASE FROM v$database;
SELECT JOB, SCHEMA_USER,
       TO_CHAR(NEXT_DATE, 'DD-MON-YYYY, HH24:MI') NEXT_DATE,
       INTERVAL, WHAT
FROM dba_jobs
ORDER BY job;
 
spool off;