Creating a RAC Flex Cluster using ansible-oracle

As of version 1.3 it is possible to create a RAC Flex Cluster using ansible-oracle. From a ansible-oracle configuration perspective there is not a huge difference from a normal ‘standard’ cluster, basically a few new parameters. There are other differences though, specifically in how you have to run the playbook and deal with the inventory configuration.
In a ‘standard’ cluster, you have your database cluster nodes and that’s it (basically). In a Flex Cluster configuration there are 2 types of nodes:

  • Hub nodes. These have access to the shared storage and will house your databases
  • Leaf nodes. These nodes are connected to the interconnect network, but not to the shared storage. So for instance, you could run your application on these nodes.

So given that, from an ansible-oracle perspective, it presents a few challenges. With a normal cluster, you could just run the playbook against all your cluster nodes as they are all the same.
Now, when building a Flex Cluster, there are a few things that should only be done on the hub nodes (configuring shared storage, install the database server and create the database(s)
And how do we do that? With a little Ansible inventory ninja-ism.

Continue reading

Changes in ansible-oracle v1.2

This is just a quick heads-up of a change that is coming, which unfortunately will not be backwards compatible.

As of version 1.2 of ansible-oracle, it is possible to have more than one database running out of an ORACLE_HOME. To make this possible a change had to be made to the structure and code that deals with installation of db software/db creation.
The dictionary structure oracle_databases had to be changed to a list structure, and this means that any config involving the ‘oracle_databases’ structure that was made before v1.2 will stop working.
The affected roles are:

  • oraswdb-install
  • oradb-create

The defaults will be changed as of the release, but any custom config you have done will have to be changed.

SO what you need to do is this:

In your config the following needs to be changed from this structure:

 oracle_databases: 
    racdb: 
       oracle_version_db: 12.1.0.2
       oracle_edition: EE
       oracle_db_name: racdb
       oracle_db_passwd: Oracle123
       oracle_db_type: RAC
       is_container: "false"
       pdb_prefix: racpdb
       num_pdbs: 2
       is_racone: "false"
       storage_type: ASM
       service_name: racdb_serv
       oracle_init_params: "open_cursors=300,processes=700"
       oracle_db_mem_percent: 30
       oracle_database_type: MULTIPURPOSE
       redolog_size_in_mb: 100
       delete_db: false

to this structure:

oracle_databases: 
   - home: racdb 
     oracle_version_db: 12.1.0.2
     oracle_edition: EE
     oracle_db_name: racdb
     oracle_db_passwd: Oracle123
     oracle_db_type: RAC
     is_container: "false"
     pdb_prefix: racpdb
     num_pdbs: 2
     is_racone: "false"
     storage_type: ASM
     service_name: racdb_serv
     oracle_init_params: "open_cursors=300,processes=700"
     oracle_db_mem_percent: 30
     oracle_database_type: MULTIPURPOSE
     redolog_size_in_mb: 100
     delete_db: false

There is a new parameter ‘home‘ which marks the ‘ending’ directory for the ORACLE_HOME, e.g: /u01/app/oracle/12.1.0.2/racdb

Then you have to line up the rest of the parameters to the ‘home’ one. This is the way yaml works so correct indentation is important.

And if you want to add more database from the same home, and perhaps add a new home with a different (or the same) version, this is what it should look like:

oracle_databases: 
   - home: racdb <-- original home
     oracle_version_db: 12.1.0.2
     oracle_edition: EE
     oracle_db_name: racdba <-- First database
     oracle_db_passwd: Oracle123
     oracle_db_type: RAC
     is_container: "false"
     pdb_prefix: racpdb
     num_pdbs: 2
     is_racone: "false"
     storage_type: ASM
     service_name: racdba_serv
     oracle_init_params: "open_cursors=300,processes=700"
     oracle_db_mem_percent: 30
     oracle_database_type: MULTIPURPOSE
     redolog_size_in_mb: 100
     delete_db: false

   - home: racdb <-- original home
     oracle_version_db: 12.1.0.2 
     oracle_edition: EE
     oracle_db_name: racdbb <-- second database using the original home
     oracle_db_passwd: Oracle123
     oracle_db_type: RAC
     is_container: "false"
     pdb_prefix: racpdb
     num_pdbs: 2
     is_racone: "false"
     storage_type: ASM
     service_name: racdbb_serv
     oracle_init_params: "open_cursors=300,processes=700"
     oracle_db_mem_percent: 30
     oracle_database_type: MULTIPURPOSE
     redolog_size_in_mb: 100
     delete_db: false

   - home:  blehome <-- new (second) home
     oracle_version_db: 11.2.0.4 <-- new version
     oracle_edition: EE
     oracle_db_name: bledb <-- new db (from the new home)
     oracle_db_passwd: Oracle123
     oracle_db_type: RAC
     is_container: "false"
     pdb_prefix: racpdb
     num_pdbs: 2
     is_racone: "false"
     storage_type: ASM
     service_name: ble_serv
     oracle_init_params: "open_cursors=300,processes=700"
     oracle_db_mem_percent: 30
     oracle_database_type: MULTIPURPOSE
     redolog_size_in_mb: 100
     delete_db: false

And that’s pretty much it.

Let me know if anything else is broken.