Overview

This resource allows you to set the defaults for all other ora types.

All ora types need a ora_setting definition. This is a pointer to a local or remote database. You need to create one for every local, remote or pluggable database you want to manage. When you don’t provide a ora_setting identifier in the title of the oracle type then it will use default as identifier. The connect string is according to the EZCONNECT naming method.

Here is an example on how to create the default settings:

ora_setting { '<SID>':
  default        => true|false,
  user           => '<username>',
  password       => '<password>',
  syspriv        => 'sysdba|sysasm|sysoper|sysbackup|sysdg|syskm',
  oracle_home    => '<path>',
  connect_string => "[//]host[:port][/service_name][:server][/instance]",
  pluggable      => true|false,
}

If you want to manage a remote database, like for instance DB1. You will have to specify a local oracle_home from where sqlplus can be started. You use ora_setting like this:

ora_setting { 'DB1':
  default        => true,
  user           => 'sys',
  password       => 'password',
  syspriv        => 'sysdba',
  oracle_home    => '/opt/oracle/12.1.0.2/db',
  connect_string => '//host1:1522/DB1',
  pluggable      => false,
}

Attributes

Attribute Name Short Description
cdb Is the database we manage a container database? If so set this value to true.
connect_string The connect string to use for the database.
contained_by The container database where this pluggable belings to.
daemonized Use daemonized sqlplus process for processing.
default Oracle types.
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.
name The name of the setting.
oracle_home The ORACLE_HOME where sqlplus can be found.
os_user The database username to use for database sysdba operations.
os_user_pwd Here is an example on how to use this:
   
password The password to use for database sys operations.
pluggable Is the database we manage a pluggable database? If so set this value to true.
provider resource.
syspriv The privilege used to connect to the database or asm.
user The database username to use for database sysdba operations.

cdb

Is the database we manage a container database? If so set this value to true. When you set this property to true, you enable container_database behaviour for this database. Here is an example on how to use this. ora_setting {container_database … cdb => true … }

Valid values are true, false.

Back to overview of ora_setting

connect_string

The connect string to use for the database.

Here is an example:

ora_setting { 'DB1':
  ...
  connect_string     => "//host1:1522/DB1",
  ...
}

Back to overview of ora_setting

contained_by

The container database where this pluggable belings to.

Here is an example:

ora_setting { 'DB1':
  ...
  contained_by     => "CDB",
  ...
}

Back to overview of ora_setting

daemonized

Use daemonized sqlplus process for processing.

By default Puppet will create a new sqlplus session for every set of information it needs to retrieve. This can put some strain on the Oracle database. When you want to decrease this, you can set the daemonized setting to true. This wil create a single daemon process for every database it needs to connect to and share this process for all sql processing.

This is however more prone to instability. So use with care.

The default value is false e.g. run sqlplus directly.

ora_setting {'mydb'
  ...
  daemonized => true,
  ...
}

Valid values are true, false.

Back to overview of ora_setting

default

When you set this value to true, this database will be used when no explcit sid is specified on the Oracle types.

Many of the of the oracle types, allow you to NOT specfify the sid and use a default sid. This makes puppet manifests easier readable and less verbose when creating a manifest for a single database.

The databasse for which you set the property default to true, is the database that will be used for those operations.

Valid values are true, false.

Back to overview of ora_setting

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_setting

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_setting

name

The name of the setting. This must be equal to the sid of the database.

Back to overview of ora_setting

oracle_home

The ORACLE_HOME where sqlplus can be found.

This is a required setting. Here is an example on how to use this:

ora_setting { 'DB1':
  ...
  oracle_home        => '/opt/oracle/12.1.0.2/db',
  ...
}

Back to overview of ora_setting

os_user

The os username to use for local Database operations The database username to use for database sysdba operations. This value is required when the database is not local. E.g the database is running on a remote server and is connected to through a remote connection string.

Here is an example on how to use this:

ora_setting { 'DB1':
  ...
  os_user => 'oracle',
  ...
}

When you don’t specify a value, Puppet takes the value oracle as default for regular databases. For ASM databases, it uses the value grid,

Back to overview of ora_setting

os_user_pwd

The os user password to use in Windows only As there is no sudo for windows we have to store the password for the os_user Here is an example on how to use this: ora_setting { ‘DB1’: … os_user_pwd => ‘', ... }

Back to overview of ora_setting

password

The password to use for database sys operations. This value is required when the database is not local. E.g the database is running on a remote server and is connected to through a remote connection string.

Here is an example on how to use this:

ora_setting { ‘DB1’: … user => ‘sys’, password => ‘password’, … }

Back to overview of ora_setting

pluggable

Is the database we manage a pluggable database? If so set this value to true.

When you set this property to true, you enable pluggable behaviour for this database. Here is an example on how to use this.

ora_setting {container_database
  ...
  pluggable => true,
  ...
}

Valid values are true, false.

Back to overview of ora_setting

provider

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

simple
Manage ora settings through yaml file

Back to overview of ora_setting

syspriv

The privilege used to connect to the database or asm.

You need to set this depending on the type of database.

ora_setting { 'DB1':
  syspriv => 'sysdba',
}

Valid values are normal, sysdba, sysasm, sysoper, sysbackup, sysdg, syskm.

Back to overview of ora_setting

user

The database username to use for database sysdba operations. This value is required when the database is not local. E.g the database is running on a remote server and is connected to through a remote connection string.

Here is an example on how to use this:

ora_setting { 'DB1':
  ...
  user               => 'sys',
  password           => 'password',
  ...
}

Back to overview of ora_setting