4 Schedule Workflows

As a cloud-based system, Oracle Orchestration is easier to manage and provides a more secure replacement for a Linux CRON utility, or as a replacement for legacy tools such as Control-M or HP Operations Orchestration. Oracle Orchestration gives you a simple UI interface to run both on-demand and scheduled operations tasks.

Oracle Orchestration's workflow scheduling capability lets you:

  • Schedule and organize tasks that were previously triggered manually.

  • Provide visibility into workflows that were previously run through CRON or other custom tools.

  • Replace expensive and hard to manage legacy workflow schedulers.

  • Seamlessly execute jobs across both cloud and on-premises IT data center assets.

  • As part of Oracle Management Cloud, provide rich integration with Oracle Log Analytics Cloud Service and Oracle IT Analytics Cloud Service.

Examples of Scheduled Workflows

  • Operating System: Log rotation, backups.

  • Shut down development compute instances at night.

  • Database Automatic Workload Repository (AWR) Generation, Data Guard Monitor, Log File Manager, Gather Statistics.

Schedule Workflows Using UI

Scheduling workflows, will allow you to set the time frame and period for the workflow to run. It can be set up as a onetime run, recurring or you can set a complex run schedule using CRON expressions.

To schedule a workflow in the Workflow Library, start by selecting a workflow and clicking Submit from the drop down menu. This will take you to the Workflow Submission screen, here you can set the schedule; set the start date, time and time zone. You can set your schedule to be One time, Recurring or CRON expression. For recurring you can choose from 15 minutes, 30 minutes, Hourly, Daily, Weekly, Monthly or Custom Interval. If recurring set the Repeat schedule by selecting from the drop-down menu. Finally set the end time for the workflow. Once all parameters are entered click on the Submit button in the top right.

To set up a CRON expression, select CRON and enter the character string as outlined in CRON Expressions.

CRON Expressions

A CRON expression is a string that specifies a time schedule for triggering a workflow in Oracle Orchestration. It consists of six required fields and one optional field, each separated by a space, which together specify when to trigger the event.

Table 4-1 CRON Expression Syntax:

Field Values Special Characters

Seconds

0-59

, - * /

Minutes

0-59

, - * /

Hours

0-23

, - * /

Day of Month

1-31

, - * ? / L W

Month

1-12 or JAN-DEC

, - * /

Day of Week

1-7 or SUN-SAT

, - * ? / L #

Year (optional)

empty or 1970-2199

, - * /

CRON Syntax Special Characters

  • * : Selects all values within a field. For example, every minute, every day or every hour.
  • ? : No specific value, it is used when no specific value is needed for a field. If the workflow needs to run on the 15th of each month, but the day of the week is not important; “?” would be the valued for my day of the week field and 15 would be the value for my day of the month field.
  • L : Last, “L” in the day-of-month field means the last day of the month. In the day-of-week field by itself, it means Saturday (7). If the value L is used in the day of the week field after another numerical value, it means the last specified day of the month.
  • W : Weekday, specifies the weekday (Monday-Friday) nearest the given day. The full syntax is “number”W. Meaning it will run the nearest weekday to “number”, for example 5W.
  • - : Specifies a set range of time. For example a 10-12 hour window starting at 10, ending at 12.
  • , : Specifies additional values. For example, “MON,WED,FRI”.
  • / : Specifies incrementing values. Full syntax is: “number”/ “number”, the first value indicates the start and the second value the increment. 0/20 in the seconds field, for example, means “0, 20, 40”, and 1/3 in the day field means that it will run every 3 days from the first of the month.
  • # : Specifies the "nth" day of the month. Full syntax is "number"#"number", where the first number is the day of the week (0: Sunday, 7:Saturday) and the second number is the month. For example 5#2 would run on the second Friday of the month.

CRON Expression Format and Examples

As we previously mentioned a CRON expression is made up of seven fields, six are mandatory and an optional field. The fields can contain any allowed value established in the table at the top, as well as any special character allowed in that field. The CRON string is expressed by separating the fields using a single space and entering the values for each field together interacting special characters and number into a sub string.

Here are some examples for CRON Expressions
  • Run daily at 6am: 0 0 6 * * ?
  • Run daily at 6am and 6pm: 0 0 6,18 * * ?
  • Run every 15 minutes: 0 0/15 0 * * ?
  • Run at 6:30pm on the last day of the month: 0 30 18 L * ?
  • Run on the 3rd Friday of the month at 4:30am: 0 30 4 ? * 6#3
  • Run on the last day of the month at 2pm: 0 0 14 L* ?