ORACLE job operations

Source: Internet
Author: User
Create a procedure first!
Then create a job to execute her regularly!
(1) create or replace procedure droptable
Tmpname varchar2 (50); cursor ftmp is
Select table_name
From all_tables
Where table_name <= 'to _ date (to_char (sysdate,
''Yyymmdd')-7'
And table_name> = 'tmp '; begin open ftmp; Loop fetch ftmp
Into tmpname; exit when ftmp % notfound; if ftmp % found then
Execute immediate 'drop
Table' | tmpname; end if; end loop; close ftmp; end;
(2)
Declare v_jobnum
Begin
Dbms_job.submit (v_jobnum, proname, sysdate, interval );
End;
The first code is to create procedure.
Is the second generation interrupted? Is it a job?
Call the proname of the package to start the job: name of the procedure to be executed
Sysdate: Start Time of job execution
Interval: interval between job execution

**************************************** ******

DECLARE v_jobnum NUMBER;
BEGIN
Dbms_job.submit (v_jobnum, 'lqsh. GetDataFromTemp; ', SYSDATE, 'sysdate + 1 ');
END;

**************************************** *******

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.