Create an Oracle job with a global temporary table during Oracle statistics

Source: Internet
Author: User
1. Create an Oracle global temporary table. The Code is as follows: SQL code DECLAREcntint; begin -- if the temporary table exists, delete SELECTcount (

1. Create an Oracle global temporary table. The Code is as follows: SQL code DECLARE cnt int; begin -- if the temporary table exists, delete SELECT count (

1. Create an Oracle global temporary table. The Code is as follows:

SQL code

The temporary table created above is independent of each stored procedure or PL/SQL block that calls it and does not affect each other. That is to say, two PL/SQL statements can be called at the same time, and the result pages will not affect each other.

2. Create an Oracle job with the following code:

SQL code

Where: job is the number automatically generated by the system, ECSS_JOB.SMSS10_Job_DailyStatus is a process (there is also a string parameter), next_date sets the next execution time, here is tomorrow morning, interval sets the interval, how long is the execution performed. The trunc function is used to remove the time in the date, that is, to get the of a day. The time is in the unit of day. Therefore, to get a score of, you need to score:

1/24 hour;
1/1440 points;
1/3600 seconds;

In addition, note that the SQL statement should not be executed multiple times, and several jobs will be submitted after the SQL statement is executed several times.

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.