In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
After Oracle 10g version, scheduler divides the attributes of job into multiple parts, program is responsible for what to do, schedule is responsible for when to do, job is simple, one word: dry.
In the previous articles, we introduced creating management Jobs, creating management Programs, and creating management Schedules. Below we demonstrate how to create jobs that are executed through schedule scheduling programs through examples.
First, create a program.
begin
dbms_scheduler.create_program(program_name => 'myprogram1',
program_action => '/bin/date',
program_type => 'EXECUTABLE',
enabled => true);
end;
/
We define a program that executes the operating system command date.
2) Then define a schedule.
begin
dbms_scheduler.create_schedule(schedule_name => 'myschedule1',
start_date => sysdate,
repeat_interval => 'FREQ=DAILY ; INTERVAL=1',
comments => 'Every 1 weeks');
end;
Debugging is performed weekly. Repeat_interval can be modified depending on implementation.
3. Finally, create a job and execute the program according to the specified schedule. The operation is as follows:
begin
dbms_scheduler.create_job(job_name => 'execOScmd',
program_name => 'myprogram1',
schedule_name => 'myschedule1',
enabled => true);
end;
When creating a job, start_date,repeat_interval,job_action, etc. do not need to be specified because these parameters are controlled by the program and schedule.
After these three steps are completed, ORACLE automatically executes the operations defined in the program on a regular basis (currently set to once a week).
4. To view the current execution, query it by *_scheduler_job_run_details (*_scheduler_jobs is also available, but the information in this view is not as comprehensive as in detail).
To view the execution of the "EXECOSCMD" task you just created, execute the following command:
SQL> select job_name,job_creator,program_name,schedule_name,to_char(start_date,'yyyy-mm-dd hh34:mi:ss'),state from user_scheduler_jobs where job_name = 'EXECOSCMD';
JOB_NAME JOB_CREATOR PROGRAM_NAME SCHEDULE_NAME TO_CHAR(START_DATE, STATE
------------------------------ ------------------------------ -------------------- --------------- ------------------- ---------------
EXECOSCMD SCOTT MYPROGRAM1 MYSCHEDULE1 2018-05-14 21:45:43 SCHEDULED
How much do you know about the SCHEDULER feature in 10g? I hope you can have a general understanding of this article, and there is still a lot to learn.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.