DB Scheduler
DB Scheduler
DOCUMENT CONTROL................................................................................................................................. 2
CONTENTS .......................................................................................................................................................... 3
1. OVERVIEW ................................................................................................................................................ 4
2. INSTALLATION........................................................................................................................................ 4
2.1 PRE-REQUISITES ........................................................................................................................................ 4
2.2 INSTALLING THE SOFTWARE ...................................................................................................................... 4
3. STARTING THE SCHEDULER DAEMON........................................................................................ 5
3.1 COMMAND LINE ........................................................................................................................................ 5
3.2 COMMAND LINE ARGUMENTS................................................................................................................... 5
4. CONFIGURING THE SCHEDULER.................................................................................................... 6
4.1 OVERVIEW.................................................................................................................................................. 6
4.2 INITIALISATION FILES ............................................................................................................................... 6
4.2.1 Mandatory Parameters..................................................................................................................... 6
4.2.2 Optional Parameters....................................................................................................................... 6
4.2.3 Run Time Variables......................................................................................................................... 7
4.2.4 Example............................................................................................................................................. 7
4.3 CONFIGURATION FILES.............................................................................................................................. 8
4.3.1 Parameters........................................................................................................................................ 8
4.3.2 Example............................................................................................................................................. 9
5. MONITORING THE SCHEDULER.................................................................................................... 10
5.1 DISPLAYING THE JOB SCHEDULE ........................................................................................................... 10
6. STANDARD SCHEDULER CONFIGURATION ON DHU CLUSTER ................................... 12
6.1 DBBACKUP ................................................................................................................................................ 12
6.2 ARC2ADSM................................................................................................................................................ 12
6.3 COMPRESS................................................................................................................................................. 12
6.4 BCP_PRD_COPY........................................................................................................................................ 12
6.5 BCP_MAIN ................................................................................................................................................. 12
1. OVERVIEW
db_scheduler is a basic job scheduling system. It is designed to compliment rather than replace existing
scheduling tools (cron/Control-M). In particular it is designed for implementation on HA clusters where it is not
possible to use cron for basic scheduling requirements.
2. INSTALLATION
2.1 Pre-requisites
The db_scheduler software requires Perl to be installed on the server. The minimum supported version of
Perl is 5.004. The Perl installation must include the standard Perl library modules. The installation script will
check the Perl environment.
Determines whether the job is to be run for BCP (Standby) databases. The scheduler inspects the dbcheck
configuration files for each database to determine whether they are classed as BCP databases. Valid values are:
N The default value. Job is not to be run against BCP databases.
Y Job is only to be run against BCP databases.
BOTH Job is to be run against all databases, irrespective of their dbcheck setting.
ORACLE_SIDS
By default the job could potentially be run against ALL databases defined in the oratab (subject to
BCP_DATABASE and START_TIME). If required this parameter can be used to restrict the job to a specific
database or databases by specifying the databases(s) in a space separated list. Unix
UK Distributed Systems Database Group 14 November 2011 db_scheduler - Installation and User Guide
Page 7
wildcards are supported in the database name(s). For example to restrict a job to ASM instances only:
ORACLE_SIDS = +ASM?
Alternatively a list of databases to be excluded from scheduling can be specified by prefixing the list with a !, eg
ORACLE_SIDS = ! +ASM?
START_TIME
START_FILE
START_FILE_OWNERS
LATE_TIME
LATE_SEV
RESCHEDULE
STOP_TIME
STOP_SEV
SUPPORT_GROUP
These allow the default scheduling keywords in the individual configuration files to be changed to avoid
keyword clashes with other jobs.
4.2.4 Example
The following is the contents of a typical initialisation file:
COMMAND_LINE = <SITE>/scripts/dbbackup_v2.ksh <ORACLE_SID> \
>/dev/null
CONFIG_FILES = <SITE>/dbbackup/dbbackup.config \
<SITE>/dbbackup/dbbackup_<ORACLE_SID>.config
UK Distributed Systems Database Group 14 November 2011 db_scheduler - Installation and User Guide
Page 8
4.3.1 Parameters
START_TIME
Specifies the times that the job is to be scheduled. One or more space separated time definitions can be specified.
Each time definition is of the form hours:minutes.
hours can be an asterix or HH (meaning every hour) or a list of comma separated hour (0-23) elements, or a
range of hours separated by a minus. A step value can also be specified, eg */2 means every 2 hours.
minutes can be an asterix or MM (meaning every minute) or a list of comma separated minute (0-59)
elements, or a range of minutes separated by a minus. A step value can also be specified, eg */5 means every 5
minutes
Both the hours and minutes values can be further qualified via a step value.
For example, all of the following are valid:
START_TIME = 12:30 16:30
4.3.2 Example
The following is the contents of a typical initialisation file:
START_TIME = 18:00
START_FILE = /tmp/ok_to_run
START_FILE_OWNERS = root oracle
LATE_TIME = 20:00
LATE_SEV = MAJOR
STOP_TIME = 22:00
STOP_SEV = CRITICAL
SUPPORT_GROUP = Oracle_CI
UK Distributed Systems Database Group 14 November 2011 db_scheduler - Installation and User Guide
Page 10
5.1.1 db_scheduler_check.ksh
This script will check the status of the scheduler daemon and attempt to restart it if it is down. Can be scheduled
periodically by cron, for example, to ensure db_scheduler availability.
5.1.2 oem_db_scheduler_check.ksh
This script can be called as an OEM UDM (User Defined Metric) Command Line to enable db_scheduler
monitoring from within OEM. Standard output from the script is as follws:
If daemon is active:
em_result=0
em_message=dbScheduler is up.
If daemon is inactive:
em_result=1
em_message=dbScheduler is down.
For jobs that have passed their scheduled start time the job status is displayed. Status can be one of the following:
hh:mm n Job completed at hh:mm with a response code of n.
UK Distributed Systems Database Group 14 November 2011 db_scheduler - Installation and User Guide
Page 11
<Running> Job is still running.
<Waiting> Job is waiting for its START_FILE dependancy to be met.
<Late> Job is waiting and has passed it's LATE_TIME.
<Missed> Job has been removed from schedule as it's STOP_TIME was passed.
<Unknown> Job has completed but did not report back to the scheduler with it's status.
In addition you can display schedule data for a different date:
${SITE}/scripts/db_scheduler.ksh schedule yyyymmdd
Or for a specific database:
${SITE}/scripts/db_scheduler.ksh schedule ${ORACLE_SID}
UK Distributed Systems Database Group 14 November 2011 db_scheduler - Installation and User Guide
Page 12
/applications/oracle/admin/site/db_scheduler/dbbackup.ini
COMMAND_LINE = <SITE>/scripts/dbbackup_v2.ksh <ORACLE_SID> >/dev/null
CONFIG_FILES = <SITE>/dbbackup/dbbackup.config \
<SITE>/dbbackup/dbbackup_<ORACLE_SID>.config
6.2 arc2adsm
/applications/oracle/admin/site/db_scheduler/arc2adsm.ini
COMMAND_LINE = <SITE>/scripts/arc2adsm.ksh <ORACLE_SID> >/dev/null
CONFIG_FILES = <SITE>/dbbackup/dbbackup.config \
<SITE>/dbbackup/dbbackup_<ORACLE_SID>.config
START_TIME = ARC2ADSM_START_TIME
6.3 compress
/applications/oracle/admin/site/db_scheduler/compress.ini
COMMAND_LINE = <SITE>/scripts/compress_archlogs.ksh <ORACLE_SID>
>/dev/null
CONFIG_FILES = <SITE>/dbbackup/dbbackup.config \
<SITE>/dbbackup/dbbackup_<ORACLE_SID>.config
START_TIME = COMPRESS_START_TIME
6.4 bcp_prd_copy
/applications/oracle/admin/site/db_scheduler/bcp_prd_copy.ini
COMMAND_LINE = <SITE>/scripts/bcp_prd_copy_new.ksh <ORACLE_SID>
>/tmp/bcp_prd_copy_<ORACLE_SID>.out 2>&1
CONFIG_FILES = <ORA_ADMIN>/config/db_scheduler.config
START_TIME = BCP_PRD_COPY_START_TIME
6.5 bcp_main
/applications/oracle/admin/site/db_scheduler/bcp_main.ini
BCP_DATABASE = Y
COMMAND_LINE = <SITE>/scripts/bcp_bkp_main_new.ksh <ORACLE_SID>
>/tmp/bcp_bkp_main_<ORACLE_SID>.out 2>&