A couple of moths ago, Enterprise Modules announced the easy to start way of making use their Oracle modules, ora_profile. Recently their modules have been updated to support the on-premise release of Oracle 18c (18.3). In this post I’ll explain how to get started using Vagrant, VirtualBox and a little bit of Git.
Preparation
To get started you should make sure both Vagrant an VirtualBox are available. On Windows hosts I discovered that having the Git package including shell utilities makes life a lot easier (vagrant ssh into the host at least works then.) As the Oracle Binaries are not freely distributable, you should download them yourself, please register with Oracle if you haven’t already.Finally, fetch my code from GitHub at https://github.com/martijnpronkAMIS/ora_demo.
Make sure to place the downloaded Oracle database Zip file in modules/software/files. If you want to go for Oracle 12.2, please include the additional patchfiles.
Starting the installation
Start the installation of your Puppetized Oracle database by going into the ora_demo directory and starting vagrant:
vagrant up ora-db18c
Give it some time, as you run this on a desktop virtual machine, it can take more time than when you run this with real (or production quality virtual) hardware. On my laptop with SSD it takes about 20 to 25 minutes to install, with a HDD it takes about 80 minutes to install.
Looking under the hood
When you look at the provided code in my repository you may notice not a lot of configuration is done: all the magic happens inside the Puppet module ora_profile. Let’s see what happens from the start of running Vagrant until our database is ready to use.
The Vagrant file
In the root of our ora_demo there is a file called Vagrantfile, this file describes some steps which will be executed to prepare and start puppet. In addition to this file there is a servers.yaml file which contains the names of the possible servers, the OS they should run (Centos 7 in this case) and their IP addresses: In this demo I have prepared two servers: ora-db122 for a 12.2 database and ora-db18c for the 18.3 database. The basic steps inside the Vagrantfile are installing the Puppet agent software, configuring it with a short shellscript and running the puppet program to begin the installation. The shellscript takes care of setting up the Puppet environment, linking the hieradata and binaries into the environment directories. After this is finished the vagrant up command is also finished and your database is ready to use.
The Puppetfile
The file named Puppetfile is used by a tool called librarian-puppet (installed using the preparation script) to download all the required Puppet modules for this installation. when you view it, you’ll see only one module mentioned, ora_profile. The module ora_profile provides it’s dependencies to librarian-puppet so it will download them. (and recursively so). When librarian-puppet is finished all the required modules are installed and useable.
The <hostname>.yaml file
The configuration for each host is described in the respective YAML file: As this is a bare minimal setup only the most required settings are provided, everything else is provided by defaults (see the defaults.yaml file in ora_profile/data).
--- role: role::oracledb::simple_db ora_profile::database::db_software::database_type: EE ora_profile::database::db_software::file_name: LINUX.X64_180000_db_home ora_profile::database::version: 18.0.0.0 ora_profile::database::db_patches: skip
The Puppetcode
As most of the intelligence is included in ora_profile, the puppet code required to get things to work is minimal: for a clean solution there is a role module that does the inclusion of the ora_profile module. See modules/role/oracledb/manifests/simpledb.pp for the role code, manifests/site.pp for the basic code to include the correct role code (it does a hiera lookup to find the required role)
Entering your database
Use ssh to connect to your new host, and use sudo to become the oracle user. By default the database instance name is DB01.The Vagrant file contains a port forward configuration, so you can also use the database from your host OS.
Expanding your configuration
When you want more, provision tablespaces, users, roles and other things, you can expand your puppetcode. In a next blog article I will create tablespaces, users and will create some objects.
Conclusion
With Enterprise modules’ ora_profile you can start using the Oracle modules from Enterprise Modules simply and quickly. Using these modules on VirtualBox for testing and evaluation purposes is permitted, please contact Enterprise Modules for licensing and additional information.