declare
  x integer;
begin
  dbms_job.submit(x,'perf_admin.do_snap(5);',sysdate,'perf_admin.next_snap(5)');
  dbms_job.submit(x,'perf_admin.snap_delete_all(15);',trunc(sysdate) + 1 + 22/24,'trunc(sysdate) + 1 + 22/24');

end;
/

begin
 dbms_scheduler.drop_job(job_name=>'UPDATE_CRD_ADMIN_HEARTBEAT');
 dbms_scheduler.create_job(job_name=>'UPDATE_CRD_ADMIN_HEARTBEAT',job_type=>'PLSQL_BLOCK',job_action=>'update crd_admin.HEARTBEAT set TIMESTAMP=systimestamp at time zone ''UTC'';',repeat_interval=>'FREQ=MINUTELY',enabled=>true);
end;
