In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Same as above
3.2 Schedules dispatches Jobs executed by Programs
Through the job that schedule dispatches the execution of program, seeing whether this description completely confuses you, it shows that you still don't understand the meaning of jobs in 10g SCHEDULERS feature management, so think twice and describe it to you more bluntly. In the 10g version, SCHEDULER divides JOB into multiple parts. What program is responsible for and when schedule is responsible for doing it, job is simple, one word: do.
In the previous sections, we have demonstrated how to create a management Jobs, create a management Programs, and create and manage a Schedules. Let's demonstrate how to create a job that schedules the execution of a program through schedule.
First, create a program, as follows:
SQL > BEGIN
2 DBMS_SCHEDULER.CREATE_PROGRAM (
3 program_name = > 'my_program1'
4 program_action = >'/ bin/date'
5 program_type = > 'EXECUTABLE'
6 enabled = > TRUE)
7 END
8 /
PL/SQL procedure successfully completed.
With the above statement, we define a program, execute the operating system command date, and enter it into the dt.log file.
Next, define a schedule, as follows:
SQL > begin
2 DBMS_SCHEDULER.CREATE_SCHEDULE (
3 schedule_name = > 'my_first_schedule'
4 start_date = > SYSDATE
5 repeat_interval = > 'FREQ= DAILY; INTERVAL=1'
6 comments = > 'Every 1 weeks')
7 END
8 /
PL/SQL procedure successfully completed.
Define debugging to be performed once a week. Here the repeat_interval can be modified according to the implementation.
Finally, create the job and execute the program according to the specified schedule, as follows:
SQL > BEGIN
2 DBMS_SCHEDULER.CREATE_JOB (
3 job_name = > 'execOScmd'
4 program_name = > 'my_program1'
5 schedule_name = > 'my_first_schedule'
6 enabled = > true)
7 END
8 /
PL/SQL procedure successfully completed.
When creating a job, start_date,repeat_interval,job_action and so on do not need to be specified, because these parameters will be controlled by program and schedule, so that when the operation is completed, ORACLE will automatically schedule (currently set to perform once a week) the operations defined in program.
To see the current execution, you can query it through * _ scheduler_job_run_details (* _ scheduler_job_log is also possible, but the information in this view is not as comprehensive as in detail). For example, to view the execution of the "EXECOSCMD" task you just created, execute the command as follows:
SQL > select log_id, log_date, status, additional_info
2 from user_scheduler_job_run_details
3 where job_name = 'EXECOSCMD'
4
LOG_ID LOG_DATE STATUS ADDITIONAL_INFO
13760 17-AUG-09 02.47.53.7 SUCCEEDED
34050 PM + 08:00
After reading this example, have you learned more about the SCHEDULER features in 10g? Don't be complacent, there are still many functions of SCHEDULER features, so read on.
= =
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.