A short time ago, Oracle released Oracle Database 12c – release 188.8.131.52. With a bunch of goodies that I would like to try out. This release can be downloaded from OTN: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/database12c-linux-download-2240591.html. And subsequently I can create or clone a Virtual Machine, do the necessary preparations and run the installer. Nothing wrong with that of course. However, my recent work with Vagrant and Puppet has made me … more efficient or lazier – I am not sure what the best expression is. Anyways, things can be really simple with today’s tools and with friends on the internet who share their own goodies (and I do not want you to take that in the wrong and possibly funny way).
In this article I will show how simple it is to have this new database release installed in a fresh Oracle Linux VM – by hardly doing anything at all! Leveraging the work done by Edwin Biemond in earlier Vagrant configuration files and in his Oradb Puppet module I have put together my own Vagrant + Puppet combination that will stamp out the CentOS 6.5 VM with Oracle Database 184.108.40.206 inside.
All I (and you) have to do now to create the VM based on these Vagrant and Puppet files (since I have already installed Vagrant and VirtualBox locally – see this article for instructions on this very simple installation):
- download the two database installation files from OTN and put them in some directory on the local file system
- download my Git repository and extract the zip file to a local directory or (Git) clone the repository to that same local directory.
- open the Vagrantfile in the root of the new local directory that holds the Git repository. Edit the highlighted line that maps a local (host) directory to the guest directory /software. The host directory should be the directory that contains the database installation files
Note: in this Vagrantfile, you can also set the name of the VM,its hostname, the assigned memory (initially 2548 MB) and the assigned IP address. You can change these settings. If you decide to change the IP address though, make sure you make the same change in the file puppet\hieradata\common.yaml.
- open a command line and navigate to directory that holds the Git repository
- run: vagrant up
- At this point, Vagrant takes over and starts to create the VM based on a Vagrant Box
After some time – between 20-30 minutes, depending on your environment – the VM is ready and running – your/my new Oracle Database 220.127.116.11 instance:
In SQL Developer/JDeveloper running on my host I created a database connection:
And for the fun of it, I tested out the JSON_TABLE operator that was introduced in Oracle Database 18.104.22.168:
So we are in business: a running database inside a fresh VM.
Database users SYS and SYSTEM are set up with password oracle. De SID is db12102. The database port is 1521.
The VM that is created uses 10.10.10.9 as its IP address. The OS users root and vagrant have vagrant as password. User oracle has oracle as password.
Note: if you want to make changes to the configuration of the VM or the database, you only have to consider a few files: Vagrantfile puppet\hieradata\common.yaml puppet\hieradata\db12c.example.com.yaml puppet\manifests\db.pp.
For example, to change the password for the database users, edit file db12c.example.com.yaml and change the values for oracle_database_sys_password and oracle_database_system_password. If you want to set a different SID or database service name, you need to edit other entries in this same file: oracle_database_name and oracle_database_service_name (set to db12cR1.example.com).