Introduction to
Redwood Cronacle
Topics
Cronacle Architecture
Redwood Explorer
Applications
What is a script?
Command text types
PL/SQL command texts
How to define parameters
Events
File events
2/
GE /
Cronacle Architecture
Process servers Redwood
Repository User Interfaces
UNIX
Redwood™
Explorer
High
Availability
Option
Windows custom
NT build
Open
VMS
XML
Portal
Web Web
Server Server
AS/400
HP300
0
Main
frame
Redwood OutRun only
3/
GE /
Redwood Explorer
For administrative users
Windows Explorer look-a-like
4/
GE /
Redwood Explorer (2)
Monitor
• Jobs
Repository
• Application
– Job Chains
– Scripts
• Events
• Destination
• Submit Frames
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 scripts at
• script-level, or at
• job-chain-level
18 /
GE /
Raise an event
Job status
Return code (only for job status = 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:
Note:The
Themove-directory
move-directoryshould
shouldbe
beresiding
residingon onthe
the
same file system as where the incoming file is created.
same file system as where the incoming file is created.
(for
(forperformance
performancereasons)
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 pre-
condition
KILLED – step is killed
DISABLED – step is disabled
31 /
GE /
Step
Job chain
step 1
Script 1 Script 2
step 2
Script 3
step 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 Script 2 Post-condition
step 2
Script 3 Post-condition
step 3 Post-condition
Script 4 Script 5
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 <step owner> <step name>
• Raise error <error code> <error
message>
• 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
Defineaascript
script
Submit
Submit
Schedule
Schedule Cronacle
scheduler
Dispatch
Dispatch Edit, re-submit &
monitor
Queue
Queue
Execute
Execute
Final
Finalstate
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
Sche- Sche- Sche- Sche-
duler duler duler duler
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 Cronacle users every Cronacle user
uses a corresponding use two or more uses the same
operating system account operating system accounts operating system account
Dynamic user switching enabled Dynamic user switching enabled NO Dynamic user switching.
(default_os_account set) (All jobs will use the account of
the owner of the executable)
53 /
GE /
Reading files
Cronacle™ Cronacle™
Transaction Servers Repository User Interfaces
UNIX
Cronacle™
Explorer
Windows custom
NT SQL*Net build
ftp
Open
VMS
XML
Portal
Web Web
Server Server
54 /
GE /
Destination
Destination
Normal Destination
Destination Destination
Destination Destination
Destination
Normal
script script
script script
script script
script
script
Format Format
Format Format
Format Format
Format
Format
55 /
GE /
Thank you!
56 /
GE /