BEGIN
  SYS.DBMS_SCHEDULER.DROP_JOB
    (job_name  => 'PATS.BUILD_ROLLUP_DATA_JOB');
END;
/

BEGIN
  SYS.DBMS_SCHEDULER.CREATE_JOB
    (
       job_name        => 'PATS.BUILD_ROLLUP_DATA_JOB'
      ,schedule_name   => 'PATS.PATS_BUILD_VSSC_ROLLUP_DATA'
      ,program_name    => 'PATS.BUILD_ROLLUP_DATA_PROGRAM'
      ,comments        => NULL
    );
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'PATS.BUILD_ROLLUP_DATA_JOB'
     ,attribute => 'RESTARTABLE'
     ,value     => TRUE);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'PATS.BUILD_ROLLUP_DATA_JOB'
     ,attribute => 'LOGGING_LEVEL'
     ,value     => SYS.DBMS_SCHEDULER.LOGGING_OFF);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
    ( name      => 'PATS.BUILD_ROLLUP_DATA_JOB'
     ,attribute => 'MAX_FAILURES');
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
    ( name      => 'PATS.BUILD_ROLLUP_DATA_JOB'
     ,attribute => 'MAX_RUNS');
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'PATS.BUILD_ROLLUP_DATA_JOB'
     ,attribute => 'STOP_ON_WINDOW_CLOSE'
     ,value     => FALSE);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'PATS.BUILD_ROLLUP_DATA_JOB'
     ,attribute => 'JOB_PRIORITY'
     ,value     => 3);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
    ( name      => 'PATS.BUILD_ROLLUP_DATA_JOB'
     ,attribute => 'SCHEDULE_LIMIT');
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'PATS.BUILD_ROLLUP_DATA_JOB'
     ,attribute => 'AUTO_DROP'
     ,value     => FALSE);

  SYS.DBMS_SCHEDULER.ENABLE
    (name                  => 'PATS.BUILD_ROLLUP_DATA_JOB');
END;
/
