- 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.
- TensorFlow與自然語言處理應(yīng)用
- 中文版SketchUp 2022完全實戰(zhàn)技術(shù)手冊
- 剪映專業(yè)版(電腦版)視頻剪輯全攻略:音效添加+轉(zhuǎn)場特效+視頻制作
- PowerPoint 2019從入門到精通(移動學(xué)習(xí)版)
- Oracle Siebel CRM 8 User Management: LITE
- The PEAR Installer Manifesto
- Oracle Fusion Middleware Patterns
- 數(shù)碼攝影后期密碼Photoshop CC調(diào)色秘籍(第2版)
- Photoshop CS6平面設(shè)計實戰(zhàn)從入門到精通(經(jīng)典暢銷版)
- NX Open API編程技術(shù)
- 中文版3ds Max 2014-VRay效果圖制作完全自學(xué)教程
- UML 2.0 in Action: A project/based tutorial
- Photoshop新媒體美工設(shè)計(視頻指導(dǎo)版)
- AI純美人物繪畫關(guān)鍵詞圖鑒(Midjourney版)
- 跟著視頻學(xué)Excel數(shù)據(jù)處理:函數(shù)篇