Automatic PL/SQL running settings in Oracle

Source: Internet
Author: User
The features of automatic PLSQL running in ORACLE: In the UNIXDE corn utility, the automatic scheduling task runs in PLSQL in ORACLE. The DBMS_JOB package allows you to schedule PLSQL

Features of automatic PL/SQL running in ORACLE: Use the DBMS_JOB package in the UNIXDE corn utility to automatically Schedule Tasks running in ORACLE's PL/SQL to allow you to schedule PL/SQL

Features of automatic PL/SQL running in Oracle:

Run the automatic scheduling task in the UNIXDE corn Utility

You can use the DBMS_JOB package in PL/SQL in ORACLE to schedule PL/SQL statement blocks so that they can run automatically at the specified time. This statement will be processed by a background process of Oracle. To facilitate pulling, you need to set two init. ora parameters:

1. JOB_QUEUE_PROCESS specifies the number of backend processes started. If it is 0 or not set, there will be no background processing to enter the job and they will not run.
2. JOB_QUEUE_INTERVAL specifies the waiting time for each process before checking the new job in seconds. In JOB_QUEUE_INTERVAL
Within seconds, a job can only be executed once at most.

---- Available online as part of DBMS_JOB. SQL
Create sequene temp_seq
Start with 1
Increment by 1;

Create or rrplace procedure TempInsert
BEGIN
Insert into temp_table (num_col, char_col)
Value (temp_seq.nextval, to_char (sysdate, 'dd-mon-yyyy hh24: mi: ss ));
COMMIT
END TempInsert;
The following SQL * Plus script enables TempInsert to run every 90 seconds;
------ Available online as part of DBMS_JOB. SQL
SQL> VARIABLE V_JobNum NUMBER
SQL> BEGIN
2 DBMS_JOB.SUBMIT (: V_JOBNUM, 'tempinsert; ', SYSDATE, 'sysdate + (90/24*60*60 )');
3 COMMIT;
4 END;

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.