Manage Oracle containers with Puppet

Manage Oracle containers with Puppet ora_config version 2.3 is a major update. It contains al lot of new features, updates and fixes. One of the major features is it allows you to manage Oracle container and pluggable database with Puppet. This blog post contains an overview of changes in ora_config V2.3

ora_config version 2.3 is a major update. It contains many new features, updates, and fixes.

Support for container and pluggable databases

On of the most import things this release brings, is support for pluggable databases. The work horse of database creation ora_database has been updated to facilitate this. Now you can create a new container database as easy as:

ora_database{'MY_CDB':
  ensure                  => present,
  ...
  container_database      => 'enabled',
  ...
}

Creating a pluggable database is also very easy. Again the ora_database type is enhanced to allow this. Here is an example:

ora_database{'MY_PDB':
  ensure                  => present,
  contained_by            => 'MY_CDB',
  pdb_admin_user          => 'PDB_ADMIN',
  pdb_admin_password      => 'manager1234',
}

All custom types are now able to see all Oracle objects in both the MY_CDB database as well as in the MY_PDB database. Creating a user in the PDB can be done like this:

ora_user { 'MY_USER@MY_PDB':
  ensure   => 'present'
  password => 'very_secret',
}

What is the difference? Nothing! Managing objects in a PDB is the same as managing objects in a regular database. Just like it is meant to be.

Check the documentation for all posibilities of ora_database.

Managing auditing

Version 2.3 of ora_config now support two types to manage auditing inside of an oracle database. If for example you wanted to enable statement auditing for PUBLIC DATABASE LINK statements, you could do this like this:

ora_statement_audit { 'PUBLIC DATABASE LINK@MY_DB':
  ensure => 'present',
}

Disabling would be as easy as setting ensure to absent:

ora_statement_audit { 'PUBLIC DATABASE LINK@MY_DB':
  ensure => 'absent',
}

Check the documentation for all posibilities of ora_statement_audit.

The other type of auditing that is now supported is object auditing.

ora_object_audit { 'SYS.AUD$@test':
  ensure            => 'present',
  comment_failure   => 'by_access',
  comment_success   => 'by_access',
  grant_failure     => 'my_session',
  grant_success     => 'by_session',
}

Check the documentation for all posibilities of ora_object_audit_audit.

ora_service now support clusters

The ora_service now support a extensive range of properties to manage services on a Oracle RAC cluster. Here is an example:

ora_service { 'MYSERVICE.DEVELOPMENT.ORG@SID1':
  ensure              => 'present',
  aq_ha_notifications => 'false',
  clb_goal            => 'LONG',
  dtp                 => 'false',
  failover_delay      => '0',
  failover_method     => 'NONE',
  failover_retries    => '0',
  failover_type       => 'NONE',
  lb_advisory         => 'THROUGHPUT',
  management_policy   => 'AUTOMATIC',
  preferred_instances => ['DB1', 'DB2'],
  server_pool         => ['POOL.DEVELOPMENT.ORG'],
  service_role        => 'PRIMARY',
  status              => 'running',
  taf_policy          => 'NONE',
}

Using different OS users

In older versions of ora_config using different os users for Oracle and ASM was support but albeit very difficult. In ora_config version 2.3. it has become very easy. You can now use the ora_setting type to manage all properties for connecting puppet to a database. Here is an example:

ora_setting { 'DB02':
  oracle_home => '/u01/app/oracle/product/12.1.0/db_home1',
  os_user     => 'non-standard',
}

With the introduction of ora_config 2.3 ALL database need a ora_setting in the manifest. When you are using ora_database to create the database, this is automatically taken care of. When you use ora_install classes to create your database, you must add this to your manifest.

You mast also add ora_setting for you ASM instances. Here is an example:

ora_setting { '+ASM':
  oracle_home => '/app/grid/product/12.1/grid',
  os_user     => 'grid',
  syspriv     => 'sysasm',
}

Manage Oracle directory mapping

Using the ora_directory type, you can now manage Oracle directory mapping with puppet. Here is an example:

ora_directory { 'ORACLE_OCM_CONFIG_DIR2@db':
  ensure         => 'present',
  directory_path => '/opt/oracle/app/11.04/ccr/state',
}

Manage database archivelogging

The startup, archive mode and force logging of the database can now be managed. Not only at creation time, by the properties autostart, archivelog and force_logging:

ora_database { 'DB':
  ensure        => 'present',
  archivelog    => 'disabled',
  autostart     => 'false',
  force_logging => 'disabled',
}

Add support for puppet generate type

The Puppet server (both Open Source as well as Puppet Enterprise) always had problems when using multiple version of a ruby type in multiple environments. Puppet now added puppet generate type as one of the methods to combat this problem. ora_config version 2.3 fully supports the puppet generate type command.

Get started

This concludes our post on the new possibilities for ora_config. If you are interested in the new posibilities, check out our FREE Starter Packs to get going.

Comments