Overview

This resource allows you to manage schedulaed jobs in the Oracle database. Here is an example on how to use this:

ora_scheduler_job{'sys.cleanup_audit_job@SID':
  ensure          => 'present',
  job_type        => 'PLSQL_BLOCK',
  job_action      => 'begin cleanup_audit; end;',
  start_date      => '18-10-2018 23:45:00',
  repeat_interval => 'FREQ=DAILY',
  comments        => 'Purge Audit Logs',
  enabled         => 'TRUE',
}

Experience the Power of Puppet for Oracle

If you want to play and experiment with Puppet and Oracle, please take a look at our playgrounds. At our playgrounds, we provide you with a pre-installed environment, where you experiment fast and easy.

Attributes

Attribute Name Short Description
auto_drop Indicates wether or not the job schould be dropped once completed.
comments Adds a comment to the job.
disable_corrective_change Disable the modification of a resource when Puppet decides it is a corrective change.
disable_corrective_ensure Disable the creation or removal of a resource when Puppet decides is a corrective change.
enabled Indicates wether or not the job is enabled.
end_date Specifies a date and time after which the job will not run anymore.
ensure The basic property that the resource should be in.
job_action Specifies what the job is supposed to do.
job_class Specifies the class for the job.
job_name The name of the dbms_scheduler job you want to manage.
job_priority Specifies the priority for the job.
job_type Specifies what type of job it is.
logging_level Specifies the level of loging for the job.
logoutput exit code.
max_failures The maximum number of failures for the job before the job is marked broken.
max_run_duration The maximum duration of the job specified in seconds.
max_runs The maximum number of runs for the job.
name The full package name including a SID.
owner The owner of the scheduler job.
provider resource.
repeat_interval Specifies the frequency at which to run the job.
report_errors Report any errors in the SQL scripts.
restartable Indicates wether or not the job can be restarted in case of failure.
schedule_limit before the run is skipped, specified in seconds.
sid SID to connect to.
start_date Specifies a date and time when this job will be started or scheduled.

auto_drop

Indicates wether or not the job schould be dropped once completed.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  auto_drop => 'TRUE',
  ...
}

Default value: ‘FALSE’

Valid values are TRUE, FALSE.

Back to overview of ora_scheduler_job

comments

Adds a comment to the job.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  comments => 'This is job my_job in schema me',
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job

disable_corrective_change

Disable the modification of a resource when Puppet decides it is a corrective change.

(requires easy_type V2.11.0 or higher)

When using a Puppet Server, Puppet knows about adaptive and corrective changes. A corrective change is when Puppet notices that the resource has changed, but the catalog has not changed. This can occur for example, when a user, by accident or willingly, changed something on the system that Puppet is managing. The normal Puppet process then repairs this and puts the resource back in the state as defined in the catalog. This process is precisely what you want most of the time, but not always. This can sometimes also occur when a hardware or network error occurs. Then Puppet cannot correctly determine the current state of the system and thinks the resource is changed, while in fact, it is not. Letting Puppet recreate remove or change the resource in these cases, is NOT wat you want.

Using the disable_corrective_change parameter, you can disable corrective changes on the current resource.

Here is an example of this:

crucial_resource {'be_carefull':
  ...
  disable_corrective_change => true,
  ...
}

When a corrective ensure does happen on the resource Puppet will not modify the resource and signal an error:

    Error: Corrective change present requested by catalog, but disabled by parameter disable_corrective_change
    Error: /Stage[main]/Main/Crucial_resource[be_carefull]/parameter: change from '10' to '20' failed: Corrective change present requested by catalog, but disabled by parameter disable_corrective_change. (corrective)

Back to overview of ora_scheduler_job

disable_corrective_ensure

Disable the creation or removal of a resource when Puppet decides is a corrective change.

(requires easy_type V2.11.0 or higher)

When using a Puppet Server, Puppet knows about adaptive and corrective changes. A corrective change is when Puppet notices that the resource has changed, but the catalog has not changed. This can occur for example, when a user, by accident or willingly, changed something on the system that Puppet is managing. The normal Puppet process then repairs this and puts the resource back in the state as defined in the catalog. This process is precisely what you want most of the time, but not always. This can sometimes also occur when a hardware or network error occurs. Then Puppet cannot correctly determine the current state of the system and thinks the resource is changed, while in fact, it is not. Letting Puppet recreate remove or change the resource in these cases, is NOT wat you want.

Using the disable_corrective_ensure parameter, you can disable corrective ensure present or ensure absent actions on the current resource.

Here is an example of this:

crucial_resource {'be_carefull':
  ensure                    => 'present',
  ...
  disable_corrective_ensure => true,
  ...
}

When a corrective ensure does happen on the resource Puppet will not create or remove the resource and signal an error:

    Error: Corrective ensure present requested by catalog, but disabled by parameter disable_corrective_ensure.
    Error: /Stage[main]/Main/Crucial_resource[be_carefull]/ensure: change from 'absent' to 'present' failed: Corrective ensure present requested by catalog, but disabled by parameter disable_corrective_ensure. (corrective)

Back to overview of ora_scheduler_job

enabled

Indicates wether or not the job is enabled.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  enabled => 'TRUE',
  ...
}

Default value: ‘TRUE’

Valid values are TRUE, FALSE.

Back to overview of ora_scheduler_job

end_date

Specifies a date and time after which the job will not run anymore. This property is specified in the European date format, ie ‘DD-MM-YYYY HH24:Mi:SS’.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  end_date => '29-04-2018 15:30:00',
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job

ensure

The basic property that the resource should be in.

Valid values are present, absent.

Back to overview of ora_scheduler_job

job_action

Specifies what the job is supposed to do. Depending on the job_type a PLSQL_BLOCK, STORED_PROCEDURE or FILENAME can be specified.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  job_action => 'begin insert into session_tab select count(9) from v$session; end;',
  ...
}

or

ora_scheduler_job{ 'me.my_job@sid':
  ...
  job_action => '/tmp/my_job.sql',
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job

job_class

Specifies the class for the job.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  job_class => 'DEFAULT_JOB_CLASS',
  ...
}

Default value: ‘DEFAULT_JOB_CLASS’

Back to overview of ora_scheduler_job

job_name

The name of the dbms_scheduler job you want to manage. The job_name is the second part of the title.

ora_scheduler_job { 'owner.job_name@sid':
  ...
}

Back to overview of ora_scheduler_job

job_priority

Specifies the priority for the job.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  job_priority => 'DEFAULT_JOB_CLASS',
  ...
}

Default value: 3

Valid values are 1, 2, 3, 4, 5.

Back to overview of ora_scheduler_job

job_type

Specifies what type of job it is. Supported values are PLSQL_BLOCK and STORED_PROCEDURE.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  job_type => 'STORED_PROCEDURE',
  ...
}

Puppet doesn’t provide a default value.

Valid values are PLSQL_BLOCK, STORED_PROCEDURE.

Back to overview of ora_scheduler_job

logging_level

Specifies the level of loging for the job. Supported values are:

  • DBMS_SCHEDULER.LOGGING_OFF
  • DBMS_SCHEDULER.LOGGING_RUNS
  • DBMS_SCHEDULER.LOGGING_FAILED_RUNS
  • DBMS_SCHEDULER.LOGGING_FULL

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  logging_level => 'DBMS_SCHEDULER.LOGGING_FULL',
  ...
}

Default value: ‘DBMS_SCHEDULER.LOGGING_OFF’

Valid values are DBMS_SCHEDULER.LOGGING_OFF, DBMS_SCHEDULER.LOGGING_RUNS, DBMS_SCHEDULER.LOGGING_FAILED_RUNS, DBMS_SCHEDULER.LOGGING_FULL.

Back to overview of ora_scheduler_job

logoutput

Whether to log command output in addition to logging the exit code. Defaults to on_failure, which only logs the output when the command has an exit code that does not match any value specified by the returns attribute. As with any resource type, the log level can be controlled with the loglevel metaparameter.

ora_exec {...:
  ...
  logoutput => true,
}

The default value is on_failure

Valid values are true, false, on_failure.

Back to overview of ora_scheduler_job

max_failures

The maximum number of failures for the job before the job is marked broken.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  max_failures => 5,
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job

max_run_duration

The maximum duration of the job specified in seconds.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  max_run_duration => '10800',
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job

max_runs

The maximum number of runs for the job.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  max_runs => 5,
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job

name

The full package name including a SID.

ora_package { 'owner.my_package@sid':
  ...
}

The SID is optional. When you don’t specify an SID, Puppet will take the database instance which has the default attribute set to true in /etc/ora_setting.yaml file and use that as the SID. We recommend to always use a full qualified name (e.g. a name including the SID).

Back to overview of ora_scheduler_job

owner

The owner of the scheduler job. This is the first part of the title string. The first part before the ..

  ora_scheduler_job { 'OWNER.JOB_NAME@SID':
  	...
  }

Back to overview of ora_scheduler_job

provider

The specific backend to use for this ora_scheduler_job resource. You will seldom need to specify this — Puppet will usually discover the appropriate provider for your platform.Available providers are:

simple
This is the generic provider for a easy_type type

Back to overview of ora_scheduler_job

repeat_interval

Specifies the frequency at which to run the job. A PL/SQL function can be used that returns the next date and time to run or a calendering syntax expression can be used.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  repeat_interval => 'FREQ=HOURLY;INTERVAL=1',
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job

report_errors

Report any errors in the SQL scripts.

When you set this value to true, the type will report any errors that occur in the SQL statements or scripts and stop processing. When you set it to false, it will ignore any SQL errors and just continue processing. The default value is true, so it will stop processing when an SQL error is generated.

Here is an example:

ora_exec{'delete from user_config':
  ...
  report_errors => true,

}

Valid values are true, false.

Back to overview of ora_scheduler_job

restartable

Indicates wether or not the job can be restarted in case of failure.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  restartable => 'TRUE',
  ...
}

Default value: ‘FALSE’

Valid values are TRUE, FALSE.

Back to overview of ora_scheduler_job

schedule_limit

Specifies the maximum delay between the scheduled time and the actual start of the job before the run is skipped, specified in seconds.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  schedule_limit => '3600',
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job

sid

SID to connect to.

All types have a name like resource@sid. The sid is optional. If you don’t specify the sid, the type will use the database from the /etc/ora_setting.yaml with the property default set to true. We advise you to either use @sid in all your manifests or leave it empty everywhere.

Back to overview of ora_scheduler_job

start_date

Specifies a date and time when this job will be started or scheduled. This property is specified in the European date format, ie ‘DD-MM-YYYY HH24:Mi:SS’.

Here is an example on how to use this:

ora_scheduler_job{ 'me.my_job@sid':
  ...
  start_date => '28-04-2018 15:30:00',
  ...
}

Puppet doesn’t provide a default value.

Back to overview of ora_scheduler_job