1. Make sure Oracle's working mode allows the queue manager (SNP process) SVRMGRL> ALTER System Enable Restricted session; or SQL> ALTER SYSTEM DISENABLE RESTRICTED Session;
2, make sure Oracle configured task queue manager startup parameters in INITSID.ORA: Job_Queue_Process = n (0); (0-36) Process JOB_QUEUE_INTERVAL = N (60); (1-3600) Second Wake up
3, add task to the task queue of the database DBMS_Job.Submit (Job Out Binary_integer, (Task) What in varchar2, (the name of the task and the entry into the parade), (Task Implementation time) Interval in varchar2, The interval of the task execution .Null: Execute it; Sysdate M: periodic, per M-day execution) No_Parse in boolean at the same time, Grant Execute on dbms_job to ...
4, the task to be executed, for the stored procedure, etc. PL / SQL block sql> variable n number; sql> begin 2 dbms_job.submit (n, 'my_job "); 3 commit; 4 end 5 / sql> print: N;
5. View job table: user_jobs, dba_jobs column: job (task number) next_date Next_sec (next time) Failures (Failed number, failure 16 times) Broken (Termination Sign, Y / N) )