Cronacle DevelopersTraining
Short Description
Download Cronacle DevelopersTraining...
Description
Int r oduct io ion n to Redwood Cr on ona acl cle e
Topics Cr onacle Ar Ar chit chite ect ctur ure e Redw edwoo ood d Expl xplor orer er Applications What is a script script? ? Command t ext t ype ypes s PL/ SQL com comm man and d text t exts s How to t o defi define ne paramet paramete er s Events File event events s 2 / GE /
Topics Cr onacle Ar Ar chit chite ect ctur ure e Redw edwoo ood d Expl xplor orer er Applications What is a script script? ? Command t ext t ype ypes s PL/ SQL com comm man and d text t exts s How to t o defi define ne paramet paramete er s Events File event events s 2 / GE /
Cr onacle Ar chit chite ect ctur ure e Process servers
Redwood Repository
User Interfaces
UNIX Redwood™ Explorer
High Availability Option Windows NT
custom build
Open VMS
W eb Server
W eb Server
XML Portal
AS/400 HP300 0 Main frame
Redwood OutRun only
3 / GE /
Redw edwoo ood d Expl xplor orer er
For adminis admini st r at ative ive us users ers Windows Explorer look-a-like
4 / GE /
Redwood Explorer (2) Monitor • Jobs Repository • Application – Job – Job Ch Chai ains ns – Scripts – Scripts • Events • Destination • Sub ubmi mitt Fr am ames es 5 / GE /
Application
Used for grouping scripts Can be used to filter jobs
6 / GE /
Script
7 / GE /
Script (2) Mandatory: • script name and description • command text Optional: • script parameters & constraints • events to raise and events to wait for • system parameters 8 / GE /
Command text
9 / GE /
Command text (2) Operating system command • 'cat /tmp/export.dmp | grep -i “error“ ' PL/SQL block • begin • ... • ... • end; 10 / GE /
Clearing jobs & files
Property clears jobs AND corresponding output and log files No. of versions to keep, and/ or Date to keep until – use expression • Sysdate+14 Per system or per user
11 / GE /
Script parameter
12 / GE /
Script parameter (2) Name Type: user, special or system Description Optional, runtime, display and command file Expression for default data (default value) • constant values • SYSDATE or USER • database function (specify owner) • SELECT statement in brackets Data type with length, precision and scale 13 / GE /
Using script parameters Substitution, for operating system scripts 'ls -l :P_DIR'
Directly, for PL/SQL-jobs and functions l_id := P_CUSTID;
14 / GE /
PL/ SQL jobs
15 / GE /
PL/ SQL jobs (2) In a PL/SQL script you can: • Submit other jobs • Job dependencies (sequential/ parallel) • Conditional execution (if..then..else) • Advanced error checking & handling
16 / GE /
Parent and child jobs Parent script
Child script Child script
A script submitting another script is called a parent script A child script is started by a parent script
17 / GE /
Event
Jobs can raise or wait for one or more events Set events for script s at • script-level, or at • job-chain-level
18 / GE /
Raise an event
Job st at us Retur n code (only for job stat us = ERROR) Incoming file
19 / GE /
Wait for an event
Waiting job may be auto-submitted by raising event Triggered job may clear event Waiting job has status EVENTWAIT 20 / GE /
With move directory Every file arriving raises an event New file detection only when event is cleared
Note: The move-directory should be residing on the Note: The move-directory should be residing on the same file system as where the incoming file is created. same file system as where the incoming file is created. (for performance reasons) (for performance reasons)
21 / GE /
Without move directory Only newest file is detected New file detection only when event is cleared
22 / GE /
Job chains
Topics What is a job chain? Step Post-condition Script call parameters
24 / GE /
Job chain
25 / GE /
What is a job chain? A job chain executes scripts in a sequential or parallel order using steps. A job chain comprises: • Steps • Script calls & Script call parameters • Pre- and post-conditions • Destination calls & Destination call parameters A job chain is a special job without job agent A job chain has no output & log file 26 / GE /
Job chains Contd. All definitions are stored in the Redwood Repository All script calls are submitted when a chain is submitted A job chain has special states (next slide) A scheduler can shutdown while a job chain has status WAITING Job chains do not inherit script call parameters 27 / GE /
Job chain states CHAINED – submitted but not executing yet
DISABLED – manual disabled in the Jobs monitor
SKIPPED – due to a pre-condition, a GOTO post-condition or "restart at point" operation MODIFIED – parameter list of an already submitted script call have been changed*) 28 / GE /
Restart & Skip steps
Manually • Re-submit the job chain in HOLD • Set one or more steps and scripts calls to DISABLED • Then edit the job chain to SCHEDULE Automatically • Use scheduling parameter “Start at specified step” 29 / GE /
Step
Is a group of script calls Results in a special job without job agent Has no output or log file. 30 / GE /
Step states CHAINED – chain is submitted but not executing yet WAITING – one or more script calls is executing COMPLETED – all scripts call have a COMPLETED status ERROR – a script call has a ERROR status SKIPPED – step is skipped by evaluating a precondition KILLED – step is killed DISABLED – step is disabled 31 / GE /
Step Job chain
step 1
Script 1
step 2
step 3
Script 2
Script 3
Script 4
Script 5
32 / GE /
Post-condition Post-condition • Is a "Proceed, exit or loop" condition • for job chains & steps • 1 or more post-conditions can be defined per job chain/step
33 / GE /
The complete picture Job chain
step 1
Script 1
step 2
step 3
Script 2
Post-condition
Script 3
Script 4
Post-condition
Script 5
Post-condition
Post-condition 34 / GE /
Post-condition
Post-condition determines the flow in the job chain Post-conditions are not customizable / extendable A job chain post-condition is a default for a step post-condition 35 / GE /
Post-condition status & action On status • Completed • Canceled • Error • Unknown • Killed • Otherwise (all other states)
36 / GE /
Post-condition status & action Action • Do nothing • Continue • Change status to COMPLETED • Go to step • Raise error • Restart chain (="iteration") • Request restart from console (= "Messages monitor") 37 / GE /
Referring to job chain parameter
Use Expression Referring job chain parameter can be IN, OUT or IN/ OUT 38 / GE /
Submit
Put a request for script submission to Cronacle Only execute privileged scripts
39 / GE /
Scheduling parameters
Every script has 6 extra scheduling parameters Use the second tab in the Submit dialog 40 / GE /
What happens? Define Define aa script script
Submit Submit
Schedule Schedule
Dispatch Dispatch
Cronacle scheduler
Edit, re-subm it & monitor
Queue Queue
Execute Execute
Final Final state state
41 / GE /
Actions upon jobs
Change parameters of a SCHEDULED job Hold a SCHEDULED job Release a HOLD job Cancel a SCHEDULED job Is used for chains… Is used for chains… Kill a RUNNING job Restart a "end-status" job without Submit dialog Restart a "end-status" job with Submit dialog
42 / GE /
Editing job parameters All original user parameter values Scheduling parameters: • Queue • Start time • Time window • Submit frame • Priority • Submit status 43 / GE /
Time windows
When may the job be executed: office hours, weekends Comprises time window elements
44 / GE /
Recursive time windows
Enabled during • e.g. only on Fridays Disabled during • e.g. not on holidays 45 / GE /
Submit frame
Cycle of repetition Comprises submit intervals Set for an individual job (at submit time) 46 / GE /
Submit frame & time windows
May contain a time window Enables irregular intervals
47 / GE /
At original time At original time property forces original starting time after reschedule 13:00
13:00
13:00
15:00
13:00
13:00
If not used, submit frame will loose original time after reschedule 15:00 15:00 48 / GE /
Queues All jobs are processed in queues Queue is served by one or more schedulers Default queue: system Queue may have max. no of concurrent jobs Job Queue defined Scheduler
Scheduler
Scheduler
Scheduler
49 / GE /
Priorities & queues Hold queue for certain priority level Jobs with higher priority will proceed Jobs with lower priority will be queued
50 / GE /
Job states initial • SCHEDULED, NEVER, CHAINED execution • RUNNING, CONSOLE, WAITING, KILLING waiting • QUEUED, OVERDUE, HOLD, QUEUEHOLD, EVENTWAIT, LOCKWAIT, MODIFIED special • DELAYED, DELETING, DISABLED, SKIPPED final • COMPLETED, CANCELED, KILLED, UNKNOWN, ERROR 51 / GE /
Job status ERROR Operating system jobs • completed if exit code ‘0’ • error if exit code > ‘0’ • Cronacle exit code = operating system exit code PL/SQL jobs • ready if no (unhandled) exception occurred • error if (unhandled) exception occurred • Cronacle exit code = Oracle error number 52 / GE /
Operating system account Unix & OpenVMS every Cronacle user uses a corresponding operating system account
Dynamic user switching enabled
Cronacle users use two or more operating system accounts
Dynamic user switching enabled (default_os_account set)
every Cronacle user uses the same operating system account
NO Dynamic user switching. (All jobs will use the account of the owner of the executable)
53 / GE /
Reading files Cronacle™ Transaction Servers
Cronacle™ Repository
User Interfaces
UNIX Cronacle™ Explorer
Windows NT
custom build
SQL*Net ft p
Open VMS
W eb Server
W eb Server
XML Portal
54 / GE /
Destination Destination
Normal Normal script script
Destination Destination script script
Destination Destination script script
Destination Destination script script
Format Format
Format Format
Format Format
Format Format
55 / GE /
View more...
Comments