Examples of ORACLE creation job jobs

Source: Internet
Author: User

--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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.