Translate

Tuesday 24 November 2015

Upgrading OCM 11g to OCM 12c (Series) 2 - Building your Study Lab

 

Check out other posts of this Series:

I am glad to see that I have received some interesting comments on the introductory post of this series.
It seems we might be getting some support from other authors/bloggers throughout this Series.

Let's move on to the second phase, which is Building your Study Lab.
 
Here is the list of software we will need to build our Study Lab. Click on each link and you will be redirected to where you can find it for downloading.
 
Exam Environment
  • Oracle Linux Release 6.5 64 bit 
  • Mozilla Browser, Text (emacs, gedit) and vi editors
  • Shell environment: bash, csh
  • Use either CLI or GUI environment and tools when available
  • Oracle Database 12c Enterprise Edition Release 12.1.0.2.0  64 bit
  • Oracle Grid Infrastructure 12c Release 1 (12.1.0.2)
  • Oracle Enterprise Manager Cloud Control 12c Rel 4

  • You will also need to download a virtualization software. In this case we will be making use of Oracle VM VirtualBox.

    I have downloaded all the software and staged onto a shared location that will be accessible from within the Virtual Machines:

    The following is the list of software needed to build the Study Lab apart from Oracle VM VirtualBox:


    List of Software Staged on Disk











     

    Oracle VM VirtualBox Virtual Machine Creation

     
    For the sake of documentation, the version I am using is 5.0.4 Release 102546.
    I have created a VM named ocmdb12c with the following configurations:
     
     
    ocmdb12c VM Properties
    Oracle VM VirtualBox ocmdb12c Properties
     
     

     

     
     

     
     
     
     
     
     
     
     

     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

     


     

    The initial idea was not to detail the Virtual Machine creation as there are plenty of great materials on the internet. However, for being thorough, I the next steps will detail  both the creation of the Virtual Machine as well as the Oracle Linux 6.5 installation.
     
    Once you have Oracle Virtual Box installed and opened, click on create a new Virtual Machine or through the Menu Machine>New:
     
     
    Create VM Machine New
     
    Create VM Machine New nome
    As for the memory allocation, I suggest a minimum of 4GB:
     
    Create VM Machine Memory Size
    ASMCA Disk Groups Hard Disk

    Create VM Machine new Harddisk

    Create VM Machine new Harddisk 2

    Select a size for the first Virtual Hard Disk. Since this will be the disk where the OS and all binaries will be located, I recommend a minimum of 30GB.

    Also, it is important to have some extra free space as we move will stage some installation software onto disk during both Grid Infrastructure and Database installation.

    Create VM Machine new Harddisk - Select Size

    Once you click Create, the virtual machine will be created and added to the list of Virtual Machines.

    Virtual Machine Settings

    So right-click on the newly created Virtual Machine to bring up all the properties:

    Create VM properties

    This will bring a new window which will allow us to tailor the Virtual Machine to our needs.

    You can optionally set Shared Clipboard to bidirectional so copying and pasting between host and VM becomes easier

    Create VM Setting Shared Clipboard

    Then, move to storage as most of the changes will be made here:

    Storage Configuration

    Create VM Configuring Storage 1

    We can see that we already have one hard disk which was added during the VM creation. We will now add two extra Virtual Disks that will serve as a Oracle ASM disks.

    Highlight the SATA controler and click on the Add hard disk push button that is displayed on the right side when you highlight the Sata controler.

    The first disk we will add will be the Oracle ASM disk for the +DATA Disk Group.

    Adding Additional Disks

    Step 1

    Create VM Add Hard Disk Push Button

    Create VM Create New Disk

    Step 2

    Click on Create new Disk.

    Create VM Machine new Harddisk

    Step 3

    For the ASM disks, I have selected Fixed Size:

    Create VM Create New Disk Storage Allocation Type

    Step 4

    Create VM Add Hard Hard Disk ASM Data Location and Size

    For better performance, my suggestion is that you place the ASM disks on a different hard drive that is attached to the host computer.

    For instance, I am creating a new Virtual Disk and placing it on an Lacie 3GB external hard drive that is connected to the host computer via USB3.

    Add another disk that will serve as the Oracle ASM disk for the Fast Recovery Area Disk Group. To do this, just repeat steps from here Step 1 to Step 4.

    Create VM Add Hard Disk ASM FRA

    We must know add a DVD image to the DVD drive so that we can boot from the DVD drive and start the Oracle Linux installation process:

    Create VM add Oracle Linux 6.5 ISO to DVD drive

    Highlight the little CD entry under the IDE Controller where it says “Empty” and click on the CD icon located on the right panel under Attributes:

    Create VM Add ISO image Choose ISO image

    Locate the Oracle Linux 6.5 Installation image you have downloaded on the first post of this series.

    Create VM ISO DVD Image Added

    Network Configuration

    For the sake of simplicity, we will be creating one Network adaptor and setting it as Host-only Adapter. If you want your guest VM to have access to the internet, you can either choose NAT or Bridged.

    Shared Folders

    As for the extra software that we will need to install on this VM, I have mounted a shared folder using the Oracle VM Virtualbox:

    Create VM Configure Shared Folders Auto-mount

    When adding a Shared Folder, choose Auto-mount.























     


    So, once you have added the VirtalBox Guest Additions to your VM, you will be able to access this shared folders under the /media mount point. I find that doing this makes my life a lot easier as all the Oracle Software we downloaded is staged in a sub-folder located under the shared folder.

    Oracle Linux Release 6.5 Installation


    As for the Oracle Linux Release 6.5 64 bit installation, I recommend following the following Installation Guide.
    I also find
    Tim Hall's post on Oracle Linux 6 Installation very useful.

    I will guide you through the a basic installation in this post.

    Starting the Oracle VM

    In the previous step, we have added an Oracle Linux 6.5 DVD image to the virtual DVD drive.

    We can now start the VM so that it will boot from the DVD drive.

    Highlight the VM and click on Start:

    Install OS Screen 1

    Select Install or Upgrade an Existing System

    Install OS Screen 2

    You may choose to test the media. I am skipping this test.

    Install OS Screen 3

    Click Next

    Install OS Screen 4

    Select the Language you want to use for the installation process and click Next.

    Install OS Screen 5

    Install OS Screen 6

    Install OS Screen 7

    Choose discard any data.

    Install OS Screen 8

    Enter a hostname for your new virtual server. I have named the server ocmdb12c and added my laptop model as a domain – xps15z.com.

    Whilst on this step, click on Configure Network.

    Install OS Screen 9

    Choose the only Network Adapter available, in this case eth0. There could be more network adapters if you had added more NICs when setting up the Virtual Machine.

    Once you have highlighted the network adapter, click on edit.

    Install OS Screen 10

    Check the Connect automatically option and set a manual IP address under the IPv4 tab.

    Install OS Screen 11

    Select Method Manual and click on Add to add a fixed IP address.

    Install OS Screen 12

    Type in an IP address and the Netmask.

    Since my virtual machine won’t have access to the external world – only to other VMs in the same subnet, I am entering neither the Gateway nor the DNS. For the VM-to-VM communication, the name resolution will happen through the /etc/hosts file for simplicity.

    Click Apply. Once you click apply, you are directed back to the initial Network Configuration screen. Click on Close.

    Install OS Screen 13

    Choose your time zone. I am selecting Europe/London because I am a little attached to it. Smile

    Install OS Screen 14

    Enter a root password and confirm it. You may receive a warning saying that your password is not strong enough. You may choose to ignore it since this is just a study lab.

    Install OS Screen 15

    Under Installation type, Select Use All Space and check the option Review and modify partitioning layout.

    Install OS Screen 16

    On the above screen, add only the first device, the one with 20GB or 30GB depending on what size you gave to this virtual disk.

    To add, highlight it and click on the arrow pointing to the right, making sure that this Data Storage Device is also marked as having the bootloader installed.

    Install OS Screen 17

    Install OS Screen 18

    Install OS Screen 20

    Install OS Screen 22

    Install OS Screen 21

    Install OS Screen 22

    On the above screenshots, I take 2048 Megabytes from the / mount point and give it to the /swap mount point.

    Install OS Screen 24

    Confirm the device where the boot loader will be installed then click Next.

    Software Components

     

    Install OS Screen 25

    Select either Basic Server or Database Server. Make sure you leave both Oracle Linux Server and UEK3 kernel repo selected under the “additional repositories”.

    Select Customize now and click Next.

    On the following screenshots, I will show you the options I selected for this specific installation. You may or may not select the same options.

    Install OS Screen 26

    Base System

    Install OS Screen 27

    Servers

    Install OS Screen 28

    Web Services

    Install OS Screen 29

    Databases

    Install OS Screen 30

    System Management

    Install OS Screen 31

    Virtualization

    Install OS Screen 32

    Desktops

    Install OS Screen 33

    Applications

    Install OS Screen 34

    Installation Progress

    Install OS Screen 35

    Click on Reboot and wait for the VM to restart. it usually ejects the DVD image from the DVD drive automatically, if that is not the case, you can do it manually via menu Devices>Optical Drives>Remove Disk From Virtual Image.

    Install OS Screen 36

    Once the VM restarted, the Welcome screen appears, click Forward.

    Install OS Screen 37

    The License Agreement.

    Install OS Screen 38

    Install OS Screen 39

    I have selected No thanks as we won’t need this for our Study Lab.

    Install OS Screen 40

    On the create user screen, I am creating my personal user and not the oracle user. We will let the oracle user to be created by the Oracle Validated RPM later.

    Install OS Screen 41

    Adjust both Time and Date accordingly.

    Install OS Screen 42

    As for the kernel crash dumping mechanism, I have left Kdump unchecked for the purpose of this Study Lab.

    Click Next and the system will revert to the logon screen.

    Install OS Screen 43

    Double click on the user you created and enter the password you have typed in during the user setup.

    Install OS Screen 44

    Install OS Screen 45

    From within the VM, click on System>About this Computer to display the System Monitor Summary Tab.

    Once you have installed the Operating System, you can optionally add the Oracle VirtualBox Guest Additions as well mounting the disk ISO as a yum source repository following this guide.

    Oracle Linux 6.5 System Monitor Window
































    You can open a Terminal Window and run some simple commands as follows:

    These are a few details of the VM I have just created:


    $ df -h
    Filesystem                       Size  Used Avail Use% Mounted on
    /dev/mapper/vg_ocmdb12c-lv_root   18G  3.7G   13G  23% /
    tmpfs                            2.0G   80K  2.0G   1% /dev/shm
    /dev/sda1                        477M   55M  397M  13% /boot


    $ ll /dev/sd*

    brw-rw----. 1 root disk 8,  0 Nov 25 00:05 /dev/sda
    brw-rw----. 1 root disk 8,  1 Nov 25 00:05 /dev/sda1
    brw-rw----. 1 root disk 8,  2 Nov 25 00:05 /dev/sda2
    brw-rw----. 1 root disk 8, 16 Nov 25 00:05 /dev/sdb
    brw-rw----. 1 root disk 8, 32 Nov 25 00:05 /dev/sdc

     

    From the above output, we can see the extra devices – /dev/sdb and /dev/sdc - that we’ve added in previous steps. These will be configured as ASM Disks on subsequent post.

    The /dev/sda device is located on my laptop local SSD disk and both /dev/sdb and /dev/sdc are located on an external Lacie hard-drive.

    A glimpse of my network configuration:

    $ ifconfig
    eth0      Link encap:Ethernet  HWaddr 08:00:27:22:04:15 
              inet addr:192.168.0.56  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: fe80::a00:27ff:fe22:415/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:215 errors:0 dropped:0 overruns:0 frame:0
              TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:20092 (19.6 KiB)  TX bytes:818 (818.0 b)

    lo        Link encap:Local Loopback 
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:48 errors:0 dropped:0 overruns:0 frame:0
              TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:3740 (3.6 KiB)  TX bytes:3740 (3.6 KiB)

     

     

    Installing Oracle VM VirtualBox Guest Additions (Recommended)

    On the Oracle Virtualbox window, click on Devices>Insert Guest Additions CD image. This will mount a CD image and popup an explorer window on the desktop:

    Install OS Screen 46

    We need to run a shell script located in this CD image named autorun.sh.

    To do this, you will need to switch your user to the root user as follows:

    cd /media
    # ls
    sf_Oracle_Software  VBOXADDITIONS_5.0.4_102546
    # cd VBOXADDITIONS_5.0.4_102546/

    ./VBoxLinuxAdditions.run
    Verifying archive integrity... All good.
    Uncompressing VirtualBox 5.0.4 Guest Additions for Linux............
    VirtualBox Guest Additions installer
    Removing installed version 5.0.4 of VirtualBox Guest Additions...
    Removing existing VirtualBox non-DKMS kernel modules       [  OK  ]
    Stopping VirtualBox Guest Addition service                 [  OK  ]
    Copying additional installer modules ...
    Installing additional modules ...
    Removing existing VirtualBox non-DKMS kernel modules       [  OK  ]
    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  ]
    You should restart your guest to make sure the new modules are actually used

    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 the Window System (or just restart the guest system)
    to enable the Guest Additions.

    Installing graphics libraries and desktop services componen[  OK  ]

     


    You might run into some trouble installing the Guest Additions. For instance, it mail fail due to lack of some OS libraries or packages. If that is the case, I suggest you follow the steps described in the post 3 – Install Oracle Grid Infrastructure under the section Configure the yum repository. This way, you can install any missing software using the DVD as the repository.

    So, now that we have installed the Oracle VirtualBox Guest Additions, we can seemingly navigate the mouse to and from the Virtual Machine as well as many other features which improve the usability of the VM. Take for instance the shared folders. Once we have installed the Guest Additions, such folders become accessible from the VM as follows:


    $ df -h
    Filesystem                       Size  Used Avail Use% Mounted on
    /dev/mapper/vg_ocmdb12c-lv_root   18G  3.7G   13G  23% /
    tmpfs                            2.0G   80K  2.0G   1% /dev/shm
    /dev/sda1                        477M   55M  397M  13% /boot
    Oracle_Software                  2.8T  2.3T  514G  82% /media/sf_Oracle_Software

    $ cd /media/sf_Oracle_Software/OCM\ 12c\ Upgrade/

    root@ocmdb12c OCM 12c Upgrade]# ll
    total 5450553
    drwxrwx---. 1 root vboxsf      40960 Nov 24 22:05 121
    -rwxrwx---. 1 root vboxsf 1673544724 Nov 24 01:56 linuxamd64_12102_database_1of2.zip
    -rwxrwx---. 1 root vboxsf 1014530602 Nov 24 00:08 linuxamd64_12102_database_2of2.zip
    -rwxrwx---. 1 root vboxsf  499228127 Nov 23 22:50 linuxamd64_12102_examples.zip
    -rwxrwx---. 1 root vboxsf 1747043545 Nov 24 02:30 linuxamd64_12102_grid_1of2.zip
    -rwxrwx---. 1 root vboxsf  646972897 Nov 23 23:45 linuxamd64_12102_grid_2of2.zip
    drwxrwx---. 1 root vboxsf       4096 Nov 24 01:51 Oracle Linux Release 6 Update 5 for x86_64 (64 Bit)

     


    How cool is that?

    In the next post, we will be covering the prerequisites for installing the Oracle Grid Infrastructure as well as the installation itself.

    Please add comments, make corrections and ask questions as I will be happy to try answering them. If I do not know the answer, I am sure someone will know and will kindly answer it.

    That's it for this post and...

    Até la!

    Daniel

    Check out other posts of this Series: