The sequence starts from 0 every morning after the Oracle stored procedure is updated.
Create a stored procedure for Oracle first;
For example, clearing a table
Create or replace procedure pro_job_delete
As
Begin
-- Dbms_output.put_line ('System time: '| to_char (sysdate, 'dd-mm-yyyy hh24: mi: ss '));
Delete tabletest;
End;
Define your own job
Declare
Job1 number;
Begin
Dbms_job.submit (job1, 'Pro _ job_delete; ', sysdate, 'trunc (SYSDATE + 1)'); -- clear records every day
End;
Locate your job and find the corresponding job Value
Select * from user_jobs;
Execute your storage job
Begin
Dbms_job.run (21); -- it corresponds to the job Value in select * from user_jobs; to see the corresponding process
End;
If you want to stop your task:
Begin
Dbms_job.remove (21); -- it corresponds to the job Value in select * from user_jobs; To see what corresponds to the Process
End;
Oracle regularly executes tasks through jobs
Understanding of the instance in which Oracle RAC jobs run
Analysis and Processing of Oracle jobs not executed
Oracle job interval rules
Learn how to create a job in an Oracle environment