RAC Attack - Oracle Cluster Database at Home/RAC Attack Automation

Whether you're a participant who has already done the early labs dozens of times or an instructor who's teaching a session that focuses on a later lab, it is often useful to skip earlier labs and focus on later labs in the RAC Attack curriculum. Code to automate the RAC Attack labs is currently being developed and tested.

This page will contain instructions for automatically building a standard RAC Attack environment.

Quick Start
At this point in time, we are working to automate the third and fourth labs - Install Linux and Create Cluster.


 * 1) Complete the first three labs: Hardware Requirements, Software Components and Prepare Host.  Do not download Oracle Linux; just the database and cluster software.
 * 2) Download and install Vagrant 1.5.1
 * 3) Download and unzip http://racattack.org/vagrantfile.zip (note that this file changes frequently as we work on it)
 * 4) Open a command prompt and change into the directory where you unzipped vagrantfile.zip
 * 5) Run the vnc client of your choice and connect to vnc://192.168.78.51:1
 * 6) discuss issues at http://racattack.org/list or https://github.com/racattack/vagrantfile/issues
 * 1) Run the vnc client of your choice and connect to vnc://192.168.78.51:1
 * 2) discuss issues at http://racattack.org/list or https://github.com/racattack/vagrantfile/issues
 * 1) Run the vnc client of your choice and connect to vnc://192.168.78.51:1
 * 2) discuss issues at http://racattack.org/list or https://github.com/racattack/vagrantfile/issues

You can now skip to Connecting to the virtual machine

Credits
This project came to you by the RAC Attack Team

Initial version: [mailto:alvaro@kikitux.net Alvaro Miranda] 14/04

Getting started
For this implementation, we will be using Vagrant, to manage VirtualBox and automate the deployment.

Software used in this implementation
Besides the software listed in for SSH, VNC and Grid and Database component, the following software have been used and tested in this implementation.


 * vagrant 1.5.1
 * packer 0.5.2

OSes that are known to work
This implementation has been tested with the following operating systems:


 * Windows 7 Professional 64 bit
 * OracleLinux 6.5 64 bit
 * Apple Mac OS X 10.9.2

OS used in the guest machine
The OS used in the guest machine is Oracle Linux 6.5 + updates.

The version of the box used reflect the day when the box was created and updated:

This version of  was created and updated to 14.03.29

Hardware requirements

 * 1) Please review  and check you meet the minimum hardware requirements.

Software Components

 * 1) Go to  and ensure you have all the Software Components listed there.

Vagrant
For this lab, you need vagrant, go to www.vagrantup.com/downloads.html, download and install vagrant software.

Introduction to Vagrant - Vagrant 101
On this lab, we will use vagrant, however it is left to the reader visit the Vagrant documentation in order to learn what other features can be useful outside this lab.

From why-vagrant page: "Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team."

Once the software is installed, a normal deployment goes like this:


 * 1) Download a vagrant box
 * 2) Create a Vagrantfile

Let's execute some commands with vagrant:

vagrant box
A vagrant box is a virtual machine template with configurations made specifically for vagrant. In order to create a box, you need to follow the steps listed at base box documentation

The box used in the lab has been created using packer version 0.5.2

Since vagrant 1.5.x you can download boxes from the internet with a simple command:

This will download the base box used for this lab.

At this point, the box racattack/oracle65 is in your system, and you can use it.

Vagrantfile
Vagrant file is where the automation starts, it will include information about what box to use, from where get it, and will execute the customization listed in the Vagrantfile

According to vagrantfile documentation, Vagrantfile is:

The primary function of the Vagrantfile is to describe the type of machine required for a project, and how to configure and provision these machines. Vagrantfiles are called Vagrantfiles because the actual literal filename for the file is Vagrantfile (casing doesn't matter).

Vagrant is meant to run with one Vagrantfile per project, and the Vagrantfile is supposed to be committed to version control. This allows other developers involved in the project to check out the code, run vagrant up, and be on their way. Vagrantfiles are portable across every platform Vagrant supports.

The syntax of Vagrantfiles is Ruby, but knowledge of the Ruby programming language is not necessary to make modifications to the Vagrantfile, since it is mostly simple variable assignment. In fact, Ruby isn't even the most popular community Vagrant is used within, which should help show you that despite not having Ruby knowledge, people are very successful with Vagrant.

To create a new Vagrantfile, you can :

This will create a simple Vagrantfile on the directory where we are executing this command.

Let's enumerate what we have learned so far:

To download a vagrant box

To list the boxes in our system

To create an initial Vagrantfile

Other commands that we will be using are:

To start/create a new vm

To connect to a vm

To reboot a vm

To stop a vm

To check status of a vm

To delete a vm

lab: create test1 vm
In this lab, we will create a simple test1 vm.



Below the output on my test machine:

Congratulations, you created and destroyed your first virtual machine with Vagrant.

Architecture
At this point, in the we are in the first step.



Our Architecture Diagram looks like this:

Code
The code for this automation implementation can be found at [racattack.org/code]

From the code, we are interested in racattack/vagrantfile repo

To download the code are 2 ways:


 * 1) Download the zip file
 * 2) Using git

Download the zip file
A zip file with all the files required for this project can be downloaded as: https://github.com/racattack/vagrantfile/archive/master.zip

Download, Unzip

You are done.

Using git
If you are familiar with git, you can download a copy of this repo as:

If you have github software installed, then you can click on this link

reviewing racattack/vagrantfile
After downloading the repo locally to your computer, you will end with a structure similar to this:

go to the OracleLinux/racattack12cR1 directory

And the structure will be something like this:

Before we create our first cluster
Now everything is in place, we can check the status of our cluster:

What this out put tell us?

It show are 2 nodes:

collabn2 not created (virtualbox) collabn1 not created (virtualbox)

It show we will be able to access them over the following network detail:

collabn2 eth1 lanip :192.168.78.52 collabn2 eth2 privip :172.16.100.52 collabn1 eth1 lanip :192.168.78.51 collabn1 eth2 privip :172.16.100.51

This mean, we will move from single node, to 2 node.

This also mean, we are one step closer in the RAC Attack Architecture.



The scripts provided in  will do all the configuration required for a Oracle RAC Cluster.

If we review the output of, we also have:

collabn2 dns server role is slave collabn1 dns server role is master

This mean, when we provision our lab,  will be a dns server master and   will be a dns server slave.

Other piece of information is: on first boot shared disks will be created, this will take some time

This is, on the first execution of  Vagrant, using our Vagrantfile will setup everything we need to have for a correct installation of an Oracle RAC 12cR1.

At this point you can do  to create your very first 2 node rac cluster using this project.

vagrant up
command, will read Vagrantfile and will create what is in this file.

This project Vagrantfile have been tested, and improved, and does all the OS requirement to have an Oracle RAC 12cR1 installation, free of issues.

Order matters
Vagrant execute the scripts and create the machines top to bottom, so for advances uses, we may end installing software, or doing some tasks after the provisioning, so for that, we need all the nodes up and running, so we will be doing collabn2 first, then collabn1. In this way, once collabn1 is up and running, we can be sure all is up and ready.

Review of vagrant up output
Let's review the output.

A sample vagrant up log can be found on the project page at https://github.com/racattack/vagrantfile/blob/master/OracleLinux/vagrant-up.log in case you want to review, before executing your own run.

At this stage, the base box is imported.

At this stage, the box is being renamed from the template, into a name suitable for us.

Vagrant magic:

Here, in the  section, is where the shared disk are created. We will review this later.

Booting the virtual machine, and setting hostname

Mounting shared folder

Executing scripts

Shared disk
In order to be closer to the RAC Attack 12cR1 Architecture, we need to have shared disks.

This implementation, performs automatically on the first boot the RacAttack Create_Virtualbox_Shared_Storage steps

Let's check collabn1

Let's connect to  and become root

Let's check the disks.


 * udev disk

We have 4 shared disks, sdc,sdd,sde,sdf We have persistent aliases


 * OracleASM disks

Shared disk created, permission set. Ready to use.

Once again, this mean we are one step closer to the RAC Attack 12cR1 Architecture:



What came included by default
On top the detailed description already provided, this Automation script does:


 * Create the required groups, for role separation per Oracle RAC Manual
 * Create user grid
 * Update groups of user oracle
 * Initialize sdb disk for oracle binaries, mount it as /u01
 * Setup DNS Settings for Master node (collabn1) slave (collabn2)
 * Setup ulimit for grid user, for role separation

Default users and password

 * User  root, password   root
 * User  grid, password   grid
 * User oracle, password oracle

Connecting to the virtual machine
At this moment, you have 2 ways how to connect to the virtual machines


 * and then  to become root.

You can became grid  user as    from vagrant You can became oracle user as   from vagrant


 * ssh/putty to the ip

You laptop computer is connected to both networks, lan 192.168.78 and priv 172.16.100.51.

So you can ssh directly to the machines.

Congratulations
At this point, you have a 2 node cluster, all ready to work.

This mean, we are 100% with the RAC Attack 12cR1 Architecture, congratulations.



What's next
Place your downloaded zip oracle binaries in racattack12cR1/12cR1:

Configure VNC session, or use X11, from: RAC_Attack_12c/VNC_Server_Setup

Configure VNC Server with the oracle account (passwords won't be displayed):

[root@collabn1 ~]# su - oracle [oracle@collabn1 ~]$ vncserver :1 You will require a password to access your desktops. Password: racattack Verify: racattack xauth: creating new authority file /home/oracle/.Xauthority New 'collabn1.racattack:1 (oracle)' desktop is collabn1.racattack:1 Creating default startup script /home/oracle/.vnc/xstartup Starting applications specified in /home/oracle/.vnc/xstartup Log file is /home/oracle/.vnc/collabn1.racattack:1.log

Open a vncviewer on your laptop and fill the ip address of collabn1 followed by :1.



Enter the password racattack when prompted:



The graphical interface is ready for the Grid Infrastructure Installation.



When you get to the interface setup of Grid Infrastructure, please have in mind that the interfaces, due Vagrant requirement are different than the 12cR1 book:

When ready to configure the networks, you need to:

Click on Identify Network Interfaces...

Check that the correct addresses are set:


 * eth0 is marked as Do Not Use


 * eth1 is marked as Public


 * eth2 is marked as Private

Click OK to close the Identify Network Interfaces window.

Finally, click Next

Now you can go to the RAC Attack 12cR1 book, and start from RAC_Attack_12c/Prepare_for_GI_install

Update base box
As today, the version of  is 14.03.29

This is the base box, the box used to create new guest machines.

When a new guest machine is created, that is on the first time you run, or when you want to recreate your system after running

In order to validate if you are in the latest version available, use command

This will check the version of the base box installed.

When a new version came out, the command to update the base box is

Example output:

Update OS
If you require to update the OS of the guest machines, the machines are configured to use public-yum from oracle.

This mean you can update executing

For more information about yum please visit http://docs.oracle.com/cd/E37670_01/E37355/html/ol_about_yum.html

RAC Attack Automation/Advanced uses
RAC Attack Automation/Advanced uses