- Mastering Oracle Scheduler in Oracle 11g Databases
- Ronald Rood
- 366字
- 2021-04-01 14:12:54
Rules
Rules in a chain describe the way the Scheduler should read the job description. A chain must have a proper starting point and end point. Steps in a chain are activated when the rules in the chain definition evaluate to true
(as rules are Boolean) and mention the specific step names to be started.
Let's return to the backup example once more. We know there is only one location where it makes sense to start the job—the step that shuts down the database. How can we make the Scheduler know that? Let's start with an overview of what we know. The steps are:
- Always start with
SHUTDOWN
. - If
SHUTDOWN
is successful, startCOPYFILES
. - If
COPYFILES
is successful, startSTARTUP
. - If
STARTUP
is successful, startEND 0
.This lists the optimum order of executions, but does not take into account a situation with failures. What should we do if
SHUTDOWN
fails? What should we do ifCOPYFILES
fails? What should we do ifSTARTUP
fails? If it is important that we act on a status, we should tell this to the Scheduler. With the current list of rules, we would end up inCHAIN_STALLED
as soon as one of the steps fails. To prevent this we should add at least one extra rule that tells the Scheduler what to do if any one of the defined steps fail. - If
SHUTDOWN
, orCOPYFILES
, orSTARTUP
fails, startEND 1
.
This last rule makes sure that our example backup always ends. It returns an error code 0
when everything succeeds and returns an error code 1
when any step in the chain fails. The error code 0
means "no error", and any other value means "failure". In this short example, it is easy to make one rule that handles all FAILED
situations. When the list of steps grows, it is more likely that we forget to mention a step. In the long run, it might be smarter to give every step its own FAILED
rule. In doing so, we end up with a larger list of rules but they are easier to check for completeness and should help us to prevent getting stuck in CHAIN_STALLED
situations.
- EJB 3.0 Database Persistence with Oracle Fusion Middleware 11g: LITE
- 社會科學數據處理軟件應用
- 性能測試從零開始
- 架構之美
- Sencha Touch Cookbook, Second Edition
- eZ Publish 4: Enterprise Web Sites Step/by/Step
- 視覺封王:Photoshop CC 2019立體化教程(素材+視頻+教案)
- 畫筆圣經 Photoshop專業繪畫技法
- Getting Started With Oracle SOA Suite 11g R1 – A Hands/On Tutorial
- Django 1.0 Website Development
- Mastering phpMyAdmin 3.1 for Effective MySQL Management
- AutoCAD 2024建筑設計從入門到精通(升級版)
- 從零開始:Indesign CC 2019設計基礎+商業設計實戰
- SketchUP草圖繪制從新手到高手
- Photoshop 2020實戰從入門到精通(超值版)