--Learning Job in 1.plsql
--Learning Job
--Build table
CreateTable Test_job (para_date date);
Commit
InsertInto Test_jobValues (sysdate);
Commit
Select*From Test_job;
--Establish the storage process
CreateOrReplaceProcedure Test_jobproceAs
Begin
InsertInto Test_jobValues (sysdate);
End Test_jobproce;
--Create Job
--Default is performed after the job is established
DECLARE test_job_reallyNumber
Begin
Dbms_job.submit (test_job_really,‘Test_jobproce;', Sysdate,‘sysdate+1/1440‘);
Commit
End
---Stop Job 25 is an established job test_job_really
Begin
Dbms_job.broken (25,true);
Commit
End
--Start Job
Begin
Dbms_job.run (25);
Commit
End
--Delete Job
Begin
Dbms_job.remove (25);
Commit
End
--View execution Results
Select*From Test_jobOrderby test_job.para_dateDesc
--View Job
Select*From Sys.user_jobs
--Use the following SQL query to see if the job is still running, provided the job execution time cannot be too short
Select*From dba_jobs_running
--In addition to the submit parameter, the remaining parameters are:
--Run Job Dbms_job.run (v_job);
-- Stop a job, inside parameter true also False,next_ The date (stop at a certain time) is also sysdate (stop immediately).
Dbms_job.broke (v_job,true,next_date);
-- delete a job
Dbms_job.remove (v_job);
Dbms_job.what (V_job, '
parameter Description:
DECLARE v_jobnum
Begin
Dbms_job.submit (V_jobnum,proname,sysdate,interval);
End
The second dating job?
Call Start Job Package Proname: The name of the procedure to be executed
Sysdate:job start time of execution
Interval:job time between execution
< Span style= "color: #008080;" >< Span style= "color: #008080;" >< Span style= "color: #ff0000;" >------------
Examples of ORACLE creation job jobs