A short time ago, Oracle released Oracle Database 12c – release 12.1.0.2. 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 12.1.0.2 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 12.1.0.2 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 12.1.0.2:
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).
Hi Lucas, the install errors with the following references ‘libXext’,’libXtst’ in db.pp in the manifests directory. If you remove those X libraries, then the install works fine.
Hi Lucas,
I have followed your article but the deployment of the DB software is failing at the unzip step. The /var/tmp/install is 775 and owned by oracle.oinstall it appears that the unzip is executed as vagrant user and fails on permission issues. The last part of the deployment is this
Notice: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Notify[oradb::installdb /oracle/product/12.1/db does not exists]/message: defined ‘message’ as ‘oradb::installdb /oracle/product/12.1/db does not exists’
Notice: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Oradb::Utils::Structure[oracle structure 12.1.0.2]/File[/var/tmp/install]/mode: mode changed ‘0777’ to ‘0775’
Notice: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Exec[extract /var/tmp/install/linuxamd64_12102_database_2of2.zip]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Exec[install oracle database 12.1.0.2_Linux-x86-64]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Exec[run root.sh script 12.1.0.2_Linux-x86-64]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/File[/oracle/product/12.1/db]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Net[config net8]/File[/var/tmp/install/netca_12.1.rsp]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Net[config net8]/Exec[install oracle net config net8]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Listener[start listener]/Exec[listener start start listener]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Database[oraDb]/File[/var/tmp/install/database_oraDb.rsp]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Database[oraDb]/Exec[install oracle database oraDb]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Dbactions[start oraDb]/Exec[start oracle database start oraDb]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: /Stage[main]/Oradb_12c/Oradb::Autostartdatabase[autostart oracle]/Exec[set dbora db12102:/oracle/product/12.1/db]: Dependency Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip] has failures: true
Notice: Finished catalog run in 8.14 seconds
Stderr from the command:
Error: unzip -o /software/linuxamd64_12102_database_1of2.zip -d /var/tmp/install/linuxamd64_12102_database returned 9 instead of one of [0]
Error: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Exec[extract /var/tmp/install/linuxamd64_12102_database_1of2.zip]/returns: change from notrun to 0 failed: unzip -o /software/linuxamd64_12102_database_1of2.zip -d /var/tmp/install/linuxamd64_12102_database returned 9 instead of one of [0]
Warning: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Exec[extract /var/tmp/install/linuxamd64_12102_database_2of2.zip]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Exec[install oracle database 12.1.0.2_Linux-x86-64]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/Exec[run root.sh script 12.1.0.2_Linux-x86-64]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Installdb[12.1.0.2_Linux-x86-64]/File[/oracle/product/12.1/db]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Net[config net8]/File[/var/tmp/install/netca_12.1.rsp]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Net[config net8]/Exec[install oracle net config net8]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Listener[start listener]/Exec[listener start start listener]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Database[oraDb]/File[/var/tmp/install/database_oraDb.rsp]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Database[oraDb]/Exec[install oracle database oraDb]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Dbactions[start oraDb]/Exec[start oracle database start oraDb]: Skipping because of failed dependencies
Warning: /Stage[main]/Oradb_12c/Oradb::Autostartdatabase[autostart oracle]/Exec[set dbora db12102:/oracle/product/12.1/db]: Skipping because of failed dependencies
I tried changing the /var/tmp/install permissions during the deployment but as you can see from the output the permissions are forced back to 775
How can I solve this?
Regards,
Frank