Installing Database 12c on Oracle Linux 6 in VirtualBox – Part 1

In this HOWTO I’ll show you how to create a virtual machine using Oracle VirtualBox and install Oracle Linux 6. In Part 2 of the HOWTO we will make a test installation of Oracle Database 12c.

Creating the Oracle Linux virtual machine

Prerequisites

      • You will need to get and install Oracle VM VirtualBox Manager 4 or later. You can download a copy from www.virtualbox.org. Perform a default installation of VirtualBox (you might have to restart your computer) and confirm that it starts correctly.
      • You will need the installation media for Oracle Linux 6 Update 4 or later. You can download it from edelivery.oracle.com/linux.
        Sign-in (or register, it’s free) and select Oracle Linux, x86 64bit at the Media Pack Search screen.

db12c_install_1
Click on the Oracle Linux Release 6 Update 4 Media Pack for x86_64 (64 bit) link.
db12c_install_2
Click the Download button in front of the DVD image (Part Number V37084-01) and save the ISO file on your PC.

Creating the virtual machine

Start Oracle VM VirtualBox Manager and select Machine → New from the top menu.

db12c_install_4

Give the virtual machine a name (mine is called “Database 12c”), set its type to Linux and the version to Oracle. Click Next.

db12c_install_5

Set the amount of RAM to 2048 MB and click Next.

db12c_install_6

Leave the “Create a virtual hard drive now” option selected and click Create.

db12c_install_7

Leave the HDD type to VDI and click Next.

db12c_install_8

Leave the allocation type to “Dynamically allocated” and click Next.

db12c_install_9

Name the disk “Oracle Linux Root” and set its size to 20 GB. Click Create.

db12c_install_10

This is the final step of the VM creation wizard, so you should see the newly created VM in your list of virtual machines. Select the machine and choose Machine → Settings from the top menu. This will open the Settings screen where we can setup additional resources.

db12c_install_11

Select Storage from the list and then select Controller from the storage tree. Click the Add hard disk button (that’s the one that looks like a set of disk plates with a green plus sign on top of them).

db12c_install_12

VirtualBox will then ask you if you want to create new or choose an existing disk. Click the Create new disk button.

db12c_install_13

Leave the type to VDI and click Next.

db12c_install_14

Select “Dynamically allocated” and click Next.

db12c_install_15

Name the disk “Oracle U01” and set its size to 20 GB.

db12c_install_16

You should now see two disks attached to your SATA controller. Time to attach the Linux ISO.

Select the Empty item under your IDE controller and then click “Set up the virtual CD/DVD drive” button (the one that looks like a CD, next to the “CD/DVD Drive” drop-down list). This will open a list of commands. Select “Choose a virtual CD/DVD disk file” from the list.

db12c_install_18

Select the Linux ISO file and click Open.

db12c_install_17

The ISO image appears under your IDE controller.

Our final task is to set up the machine networks, so you can comfortably interact with it while still having internet access from inside the VM. Click Network from the list on the left.

db12c_install_19

Set Adapter 1 to “Host-only Adapter” and make sure the “Enable Network Adapter” option is checked. Then click the “Adapter 2” tab.

db12c_install_20

Enable the second adapter and set its “Attached to” option to NAT. Click OK.
The virtual machine is now fully configured. Time to boot it up and start the Linux installation.

Installing Oracle Linux 6

Select the newly created VM and click Machine → Start from the VirtualBox Manager’s menu. This will start the virtual machine and it will automatically boot from the Oracle Linux ISO image.

db12c_install_21

Press Enter.

db12c_install_22

Skip the media testing by selecting Skip.

db12c_install_23

The installer will boot into graphical mode. Select Next.

db12c_install_24

Select English (English) and click Next.

db12c_install_25

Set your keyboard layout and click Next.

db12c_install_26

Select “Basic Storage Devices” and click Next.

db12c_install_27

You will get a warning that all data on the unpartitioned disks is going to be lost. Select “Yes, discard any data” and move on.

db12c_install_28

Set the hostname to ol6 (for Oracle Linux 6) and click Next.

db12c_install_29

Select your time zone and click Next.

db12c_install_30

Set the root password and click Next.

db12c_install_31

Select “Create Custom Layout” and click Next.

db12c_install_32

Select the free space for the first disk and click Create.

db12c_install_33

Select “Standard Partition” and click Create.

db12c_install_34

Set the mount point to /boot, the file system to ext4 and the size to 150 MB. Select the “Force to be a primary partition” option and click OK.

Create the remaining partitions using the following table:

<th”>Mount Point

Size (MB) File System Drive
N.A. 4096 swap sda
/ Fill to maximum allowable size ext4 sda
/u01 Fill to maximum allowable size ext4 sdb

db12c_install_35

After all partitions are put in place click Next. You will get a warning before the installer writes the new partition configuration.

db12c_install_37

Click “Write changes to disk”.

db12c_install_38

Leave the boot loader options by default and click Next.

db12c_install_39

Set the software set to Desktop and click Next. This will add the GUI environment (X11 and Gnome shell) to our installation.

db12c_install_40

This is where the installer starts copying all the packages from the installation media to the root partition.

db12c_install_41

You will have to restart the virtual machine after the copying completes. Click Reboot.

When the machine boots for the first time you will have to go through a first boot configuration process.

db12c_install_42

Click Forward.

db12c_install_43

Accept the licence agreement by selecting “Yes, I agree to the Licence Agreement” and click Forward.

db12c_install_44

You can skip the ULN registration as this is a test installation. Click Forward.

db12c_install_45

Do not create additional users. Click Forward and pay no attention to the warning.

db12c_install_46

Set the correct date and time and click Forward.

db12c_install_47

Do not enable Kdump. Click Finish.

db12c_install_48

The first boot configuration is now completed. Select Other at the login screen and login as root.

Configuring the Oracle Linux installation

There are a few more steps that you need to go through until your Linux installation is fully functional. You will have to configure your networks, update the system, install the guest additions etc.

Setting up networking
Open a terminal console and edit the ifcfg-eth0 script.

[root@ol6 Desktop]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Confirm the device starts on system boot – the ONBOOT option must be set to “yes”.

ONBOOT=yes

Do the same for the eth1 adapter. Check the ifcfg-eth1 script:

[root@ol6 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1

And set ONBOOT to “yes”.

ONBOOT=yes

Bring up the two interfaces.

[root@ol6 ~]# ifup eth0
Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
state: activated
Connection activated
[root@ol6 ~]# ifup eth1
Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/3
state: activated
Connection activated
[root@ol6 ~]#

Get the IP address assigned to eth0.

[root@ol6 ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:1E:EA:F0
inet addr:192.168.56.101 Bcast:192.168.56.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe1e:eaf0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:283 errors:0 dropped:0 overruns:0 frame:0
TX packets:128 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:35577 (34.7 KiB) TX bytes:18253 (17.8 KiB)

[root@ol6 ~]#

Put a line in /etc/hosts with the address and the machine host name.

192.168.56.101 ol6

Make sure that the host name resolves correctly (try to ping it and confirm that the reply comes from the IP assigned to eth0).

Updating the system
Open a terminal session and use yum to update the installation.

[root@ol6 ~]# yum update
Loaded plugins: refresh-packagekit, security
Setting up Update Process
...
 tzdata                                                    noarch                              2013c-2.el6                                                   ol6_latest                                  460 k
 tzdata-java                                               noarch                              2013c-2.el6                                                   ol6_latest                                  157 k
 upstart                                                   x86_64                              0.6.5-12.el6_4.1                                              ol6_latest                                  176 k
 util-linux-ng                                             x86_64                              2.17.2-12.9.el6_4.3                                           ol6_latest                                  1.5 M
 vte                                                       x86_64                              0.25.1-8.el6_4                                                ol6_latest                                  353 k
 wpa_supplicant                                            x86_64                              1:0.7.3-4.el6_3                                               ol6_latest                                  365 k
 xkeyboard-config                                          noarch                              2.6-6.0.1.el6                                                 ol6_latest                                  710 k
 xorg-x11-drv-mach64                                       x86_64                              6.9.3-4.1.el6_4                                               ol6_latest                                   53 k
 xulrunner                                                 x86_64                              17.0.7-1.0.1.el6_4                                            ol6_latest                                   14 M
 yelp                                                      x86_64                              2.28.1-17.el6_3                                               ol6_latest                                  812 k

Transaction Summary
===============================================================================================================================================================================================================
Install       3 Package(s)
Upgrade     136 Package(s)

Total download size: 264 M
Is this ok [y/N]:y
Downloading Packages:
(1/139): autofs-5.0.5-74.0.1.el6_4.x86_64.rpm                                                                                                                                           | 485 kB     00:02
(2/139): bind-libs-9.8.2-0.17.rc1.0.2.el6_4.4.x86_64.rpm                                                                                                                                | 878 kB     00:05
(3/139): bind-utils-9.8.2-0.17.rc1.0.2.el6_4.4.x86_64.rpm                                                                                                                               | 182 kB     00:01
(4/139): boost-filesystem-1.41.0-17.el6_4.x86_64.rpm                                                                                                                                    |  44 kB     00:00
(5/139): boost-system-1.41.0-17.el6_4.x86_64.rpm                                                                                                                                        |  23 kB     00:00
...
(137/139): xorg-x11-drv-mach64-6.9.3-4.1.el6_4.x86_64.rpm                                                                                                                               |  53 kB     00:00
(138/139): xulrunner-17.0.7-1.0.1.el6_4.x86_64.rpm                                                                                                                                      |  14 MB     00:36
(139/139): yelp-2.28.1-17.el6_3.x86_64.rpm                                                                                                                                              | 812 kB     00:02
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                          175 kB/s | 264 MB     25:46
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Retrieving key from http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
Importing GPG key 0xEC551F03:
 Userid: "Oracle OSS group (Open Source Software group) "
 From  : http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6
Is this ok [y/N]:y
Running rpm_check_debug
Running Transaction Test
...
  util-linux-ng.x86_64 0:2.17.2-12.9.el6_4.3                           vte.x86_64 0:0.25.1-8.el6_4                                         wpa_supplicant.x86_64 1:0.7.3-4.el6_3
  xkeyboard-config.noarch 0:2.6-6.0.1.el6                              xorg-x11-drv-mach64.x86_64 0:6.9.3-4.1.el6_4                        xulrunner.x86_64 0:17.0.7-1.0.1.el6_4
  yelp.x86_64 0:2.28.1-17.el6_3

Complete!
[root@ol6 ~]#

Installing guest additions
The guest additions is a pack of device drivers and applications that improve the guest operating system usability and performance. Before installing them we need to add some more OS packages required by the additions.

[root@ol6 ~]# yum install gcc kernel-uek-devel-2.6.39-400.17.1.el6uek.x86_64
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-3.el6 will be installed
---> Package kernel-uek-devel.x86_64 0:2.6.39-400.17.1.el6uek will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================================
 Package                                            Arch                                     Version                                                    Repository                                        Size
===============================================================================================================================================================================================================
Installing:
 gcc                                                x86_64                                   4.4.7-3.el6                                                ol6_latest                                        10 M
 kernel-uek-devel                                   x86_64                                   2.6.39-400.17.1.el6uek                                     ol6_UEK_latest                                   7.9 M

Transaction Summary
===============================================================================================================================================================================================================
Install       2 Package(s)

Total download size: 18 M
Installed size: 46 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): gcc-4.4.7-3.el6.x86_64.rpm                                                                                                                                                       |  10 MB     00:26
(2/2): kernel-uek-devel-2.6.39-400.17.1.el6uek.x86_64.rpm                                                                                                                               | 7.9 MB     00:19
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                          397 kB/s |  18 MB     00:46
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : kernel-uek-devel-2.6.39-400.17.1.el6uek.x86_64                                                                                                                                              1/2
  Installing : gcc-4.4.7-3.el6.x86_64                                                                                                                                                                      2/2
  Verifying  : gcc-4.4.7-3.el6.x86_64                                                                                                                                                                      1/2
  Verifying  : kernel-uek-devel-2.6.39-400.17.1.el6uek.x86_64                                                                                                                                              2/2

Installed:
  gcc.x86_64 0:4.4.7-3.el6                                                                   kernel-uek-devel.x86_64 0:2.6.39-400.17.1.el6uek

Complete!
[root@ol6 ~]#

Now go to the Devices menu of VirtualBox Manager and select “Install Guest Additions…”.

db12c_install_54

VirtualBox will mount the additions installation under /media/VBOXADDITIONS_version_number. Go to this directory and launch the installation.

[root@ol6 VBOXADDITIONS_4.2.16_86992]# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.16 Guest Additions for Linux............
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module                   [  OK  ]
Building the shared folder support module                  [  OK  ]
Building the OpenGL support module                         [  OK  ]
Doing non-kernel setup of the Guest Additions              [  OK  ]
Starting the VirtualBox Guest Additions                    [  OK  ]
Installing the Window System drivers
Installing X.Org Server 1.13 modules                       [  OK  ]
Setting up the Window System to use the Guest Additions    [  OK  ]
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.

Installing graphics libraries and desktop services componen[  OK  ]
[root@ol6 VBOXADDITIONS_4.2.16_86992]#

Reboot the guest to enable the Guest Additions.

The virtual machine is now fully configured. Time to deal with the Oracle Database 12c installation.