- 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.
- Excel圖表與表格實戰技巧精粹
- Microsoft Visual C++ Windows Applications by Example
- Expert Cube Development with Microsoft SQL Server 2008 Analysis Services
- Lightroom Classic完全自學一本通
- Illustrator CS6核心應用案例教程(全彩慕課版)
- 微信小程序開發入門與實踐
- 剪映:短視頻剪輯/字幕/動畫/AI從新手到高手(手機版+電腦版)
- 中文版 Photoshop CC 從入門到精通
- Photoshop CC 2017從入門到精通
- iPad+Procreate室內設計手繪表現技法
- CAXA電子圖板2016基礎與實例教程
- AutoCAD 2022中文版完全自學一本通
- 中文版3ds Max 2022基礎教程
- Cinema 4D基礎培訓教材
- Photoshop攝影后期必修5項核心技法 基本調整+光影校正+色彩修飾+局部處理+銳化降噪