Installing Oracle 11.2.0.3 on CentOS 6.3 on VMware Workstation 8.

In this blog post, we are going to install Oracle 11.2.0.3 64-bit on CentOS 6.3 using VMware Workstation 8. Given that Oracle no longer offers ASMLib for non Oracle branded Linux, we are going to use UDEV rules to manage the disk presentation to ASM.

In my 10-part post on installing Oracle RAC on VMware Workstation I deliberately used an excessive number of screen shots to guide readers through the process. This time I am going to assume you are already comfortable with the Oracle GUI installers, and will skip over excess details to condense this down into a single blog post.

Time Required: 120 minutes

Class Materials:

  • An x86 64-bit computer with 2GB RAM and 5GB of hard disk space.
  • A minimum of a 1024×768 display with 256 colors.
  • VMware Workstation 8 or better.
  • Whatever OS VMware Workstation needs to run on. In my case I run it on Windows 7 Professional.
  • Oracle Grid and Database software version 11.2.0.3.

You can download the software you need from the following links.

Note that for Oracle, we need the 11.2.0.3 version of the software, not the 11.2.0.1 that is available from download.oracle.com. Oracle 11.2.0.1 is not supported on CentOS 6. As far as I know you will need to get this from My Oracle Support, and you are looking for patch number 10404530 which will give you access to seven zip files. You only need the first three zip files.

Software Download Summary:

Software Product Download Link
VMware Workstation VMware Workstation download
CentOS 6.3 64-bit CentOS Linux download
Oracle 11.2.0.3 Database Oracle 11gR2 11.2.0.3 Grid for x86 64-bit Download
Oracle 11.2.0.3 Grid Oracle 11gR2 11.2.0.3 Database for x86 64-bit Download

 

Part I – Create the CentOS VM.

Time Required: 10 mins.

First we need to create a CentOS VM. I created a new VM using the VMware Workstation wizard. VMware Workstation 8 recognizes the CentOS 6.3 install ISO image as CentOS 64-bit and allows Easy Installer to do most of the work.

I created my VM with 2GB RAM and a single 20GB SCSI disks. Pretty basic but then I am just using this for play space.

 

Part II – Add Required RPMs.

Time Required: 10 mins.

Oracle 11.2.0.3 requires extra RPMs from the install media.

The following command should load all needed RPMs for 11.2.0.3 Grid and Database.

rpm -ivh compat-libstdc++-33-3.2.3-69.el6.*.rpm \
 elfutils-devel-0.152-1.el6.x86_64.rpm \
 elfutils-libelf-devel-0.152-1.el6.x86_64.rpm \
 gcc-c++-4.4.6-4.el6.x86_64.rpm \
 glibc-2.12-1.80.el6.i686.rpm \
 glibc-devel-2.12-1.80.el6.i686.rpm \
 libaio-devel-0.3.107-10.el6.x86_64.rpm \
 libaio-0.3.107-10.el6.i686.rpm \
 libgcc-4.4.6-4.el6.i686.rpm \
 libstdc++-devel-4.4.6-4.el6.x86_64.rpm \
 libtool-ltdl-2.2.6-15.5.el6.i686.rpm \
 nss-softokn-freebl-3.12.9-11.el6.i686.rpm \
 readline-6.0-4.el6.i686.rpm \
 ncurses-libs-5.7-3.20090208.el6.i686.rpm \
 libcap-2.16-5.5.el6.i686.rpm \
 libattr-2.4.44-7.el6.i686.rpm \
 compat-libcap1-1.10-1.*.rpm

 
Please note that not all the above RPMs are listed by the Oracle Installer as required. However testing has shown that they are needed to complete the install.

With our install DVD ISO mounted to the VM, log in as root, shift to the package install directory and execute the command:

[root@localhost ~]# cd "/media/CentOS_6.3_Final/Packages/"

 
CentOS should respond with:

warning: compat-libstdc++-33-3.2.3-69.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:libstdc++-devel        ########################################### [  5%]
   2:elfutils-libelf-devel  ########################################### [ 11%]
   3:libgcc                 ########################################### [ 16%]
   4:elfutils-devel         ########################################### [ 21%]
   5:nss-softokn-freebl     ########################################### [ 26%]
   6:glibc                  ########################################### [ 32%]
   7:compat-libstdc++-33    ########################################### [ 37%]
   8:gcc-c++                ########################################### [ 42%]
   9:glibc-devel            ########################################### [ 47%]
  10:compat-libcap1         ########################################### [ 53%]
  11:libaio                 ########################################### [ 58%]
  12:ncurses-libs           ########################################### [ 63%]
  13:libattr                ########################################### [ 68%]
  14:libaio-devel           ########################################### [ 74%]
  15:libcap                 ########################################### [ 79%]
  16:readline               ########################################### [ 84%]
  17:compat-libstdc++-33    ########################################### [ 89%]
  18:libtool-ltdl           ########################################### [ 95%]
  19:compat-libcap1         ########################################### [100%]

 

If you want the pdksh RPM then you will have to download it from the web. Luckily it seems CentOS 6.3 has all the required packages to support it already, so there is no RPM dependency hell for this one.

[root@localhost ~]# rpm -ivh pdksh-5.2.14-30.x86_64.rpm
warning: pdksh-5.2.14-30.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 73307de6: NOKEY
Preparing...                ########################################### [100%]
   1:pdksh                  ########################################### [100%]

 

 

Part III – Configure the Kernel.

Time Required: 10 mins.

Next we need to configure the CentOS 6.3 Linux kernel to support Oracle 11gR2 11.2.0.3.

Before we can install Oracle 11.2.0.3 on our new VM, we need configure the Linux kernel. The following steps modify key settings to allow Oracle to execute.

Edit the /etc/sysctl.conf and add following lines:

# added for Oracle 11.2.0.3
kernel.shmall = 2097152
kernel.shmmax = 982431744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

 
Now execute sysctl -p command to apply the new settings:

Edit the /etc/pam.d/login file and add following line:

# added for Oracle 11.2.0.3
session    required     pam_limits.so

 
Edit the /etc/security/limits.conf file and add following lines:

# added for Oracle 11.2.0.3
oracle    soft  nproc   2047
oracle    hard  nproc   16384
oracle    soft  nofile  1024
oracle    hard  nofile  65536

 
Check current status of SELinux:

[root@localhost ~]# /usr/sbin/getenforce
Enforcing

 
If output is Enforcing then change mode to Permissive as follows:

[root@localhost ~]# /usr/sbin/setenforce 0

 
To make the change permanent, modify the /etc/sysconfig/selinux change value of SELINUX variable to disabled:

[root@localhost ~]# cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

 
Now we have the CentOS 6.3 Linux kernel ready for Oracle 11.2.0.3.

 

Part IV – Add the Oracle User.

Time Required: 10 mins.

Next we need to create the Oracle user account, OS groups and mount point.

The Oracle software will be installed and owned by the oracle user account. In additional several OS groups are created that allow other non oracle OS users privileged access to the database and grid resources.

Login as root and create the user oracle account and the OS groups:

[root@localhost ~]# groupadd dba
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd asmdba
[root@localhost ~]# groupadd asmadmin
[root@localhost ~]# useradd -g oinstall -G dba,asmdba,asmadmin oracle

 
Now set the password for the oracle user. Since this is development, I suggest we stick with “oracle”.

[root@localhost ~]# passwd oracle
Changing password for user oracle.
New UNIX password: 
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password: 
passwd: all authentication tokens updated successfully.

 

Now we create a directory into which the oracle software will be installed. We need to set this new directory to be owned by oracle:

[root@localhost ~]# mkdir /u01
[root@localhost ~]# mkdir /u01/app
[root@localhost ~]# chown oracle:dba /u01/app

 
Now we can log into our new oracle account and configure the bash profile:

[root@localhost ~]#  su - oracle
[oracle@localhost ~]$  vi ~/.bash_profile

 
Add the following lines to the profile script:

TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=`hostname`; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi

 
 

Part V – Add Disk for ASM.

Time Required: 20 mins.

At this point we are going to shut down our VM and add a second SCSI disk. Using the VMware Workstation menu, select Create a new virtual disk and then select SCSI. Do not check Independent. Disk size should be 5GB or larger. It doesn’t matter if the disk is fully allocated immediately or if the disk is split into multiple parts.

Once the disk is added, navigate to the directory where the VM files are stored and edit the VMX file. Add the following directive:

disk.EnableUUID = "TRUE"

 
This directive is needed to allow VMware Workstation to provude unique SCSI identifiers to Linux.

Now you can restart the VM.

When the VM is restarted, log in as root and use fdisk to partition the new disk. In this example we have added /dev/sdb

Set the partition offset to 2048 sectors.

[root@localhost ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): u
Changing display/entry units to sectors

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (63-10485759, default 63): 2048
Last sector or +size or +sizeM or +sizeK (2048-10485759, default 10485759): 
Using default value 10485759

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

 
With the new disk added, we can use scsi_id to determine the SCSI identifier of the new device:

[root@localhost ~]# scsi_id -g -u -d /dev/sdb
36000c2980c56d98cc5150a0ac103058d

 
So the SCSI identifier of the new disk is 36000c2980c56d98cc5150a0ac103058d. We can now use this with UDEV rules to set the permission of the new device as well as an alias.

We are going to create (or edit) a file in the /etc/udev/rules.d directory. In this case we are calling our file 50-udev.rules.

[root@localhost ~]# vi /etc/udev/rules.d/50-udev.rules

 
And we add the following line – this should all be one line:

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", 
RESULT=="36000c2980c56d98cc5150a0ac103058d", NAME="oracleasm/asm-disk1", 
OWNER="oracle", GROUP="dba", MODE="0660"

 
In the above example we have instructed CentOS to create an alias called /dev/oracleasm/asm-disk-1 when it finds the SCSI ID 36000c2980c56d98cc5150a0ac103058d. The alias will be owned by the oracle user and have permissions of 660.

I chose this alias as it matches those used by the old ASMLib.

Once the file is created, we restart udev as follows:

[root@localhost ~]# /sbin/start_udev
Starting udev:                                             [  OK  ]

 
We can now check that the alias exists:

[root@localhost ~]# ls -al /dev/oracleasm/*
total 0
drwxr-xr-x  2 root   root    60 Nov  6 12:27 .
drwxr-xr-x 19 root   root  3900 Nov  6 12:27 ..
brw-rw----  1 oracle dba  8, 17 Nov  6 12:27 asm-disk1

 
 

Part VI – Install Grid.

Time Required: 30 mins.

Next we will install the Grid Infrastructure home to provide support for ASM.

For Oracle 11.2.0.3 this means unzipping file p10404530_112030_platform_3of7.zip.

This will create a grid directory. Change into the grid directory and launch the runInstaller script.

The Grid install menu consists of ten steps. Since I am not taking screen shots this time, here are the basic steps involved:

Step 1:

Skip Software Updates.

Step 2:

Configure Oracle Grid Infrastructure for a Standalone Server.

Step 3:

Choose the languages you want.

Step 4:

Select the Change Discovery Path button and enter /dev/oracleasm.

This should present the /dev/oracleasm/asm-disk-1 option we created in the last step.

Select that disk, external redundancy, 1MB AU size and a diskgroup name of DATA.

Step 5:

Set the passwords for the SYS and ASMSNMP accounts:

Step 6:

Accept the defaults.

Step 7:

Accept the defaults.

Step 8:

Accept the defaults.

Step 9:

If you completed parts 2, 3 and 4 correctly, we should jump straight to step 10.

Step 10:

Click Install.

Step 11:

A window will appear at 76% complete prompting to execute two scripts as root:

  • /u01/app/oraInventory/orainstRoot.sh
  • /u01/app/oracle/product/11.2.0/db_1/root.sh

If you have completed all steps thus far, this should be a simple process:

[root@localhost ~]# cd /u01/app/oraInventory
[root@localhost oraInventory]# ./orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.

 

[root@localhost oraInventory]# cd /u01/app/oracle/product/11.2.0/grid
[root@localhost grid]# ./root.sh
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
LOCAL ADD MODE 
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE 
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node localhost successfully pinned.
Adding Clusterware entries to upstart

localhost     2012/11/10 22:01:51     /u01/app/oracle/product/11.2.0/grid/cdata/localhost/backup_20121110_220151.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

 
Note if the root.sh script blows up with an error similar to:

/u01/app/oracle/product/11.2.0/db_1/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
Failed to create keys in the OLR, rc = 32512, 32512

 
Then go back and re-check the RPM requirements from Step 2. The libcap-1 and libcap-2 RPMs are missing.

The installer should now continue and complete the Grid install.

 

Part VII – Install Database.

Time Required: 30 mins.

Next we will install the Database home and create a database.

For Oracle 11.2.0.3 this means unzipping files p10404530_112030_platform_1of7.zip and p10404530_112030_platform_2of7.zip. Note these should be unzipped into the same directory, and not separate directories as was the case in older releases.

This will create a database directory. Change into the database directory and launch the runInstaller script.

The Database install menu consists of twenty-one steps. Since I am not taking screen shots this time, here are the basic steps involved:

Step 1:

I don’t want any more spam thanks.

Step 2:

Skip the updates.

Step 3:

Create and configure a database.

Step 4:

Server Class.

Step 5:

Single instance database installation.

Step 6:

Advanced install.

Step 7:

Choose the languages you want.

Step 8:

Enterprise Edition.

Step 9:

Choose the defaults, but Grid and Database must be in different directories.

Step 10:

General Purpose / Transaction Processing.

Step 11:

Select a database name.

Step 12:

Add in the Sample Schemas.

Step 13:

Use Oracle Enterprise Manager Database Control for database management.

Step 14:

Use Automatic Storage Management.

I hope you remembered the password you selected back in Part VI.

Step 15:

Do not enable automated backups

Step 16:

Select the DATA diskgroup.

Step 17:

Set the passwords for the database.

Step 18:

Accept the defaults.

Step 19:

If you completed all parts properly, we should jump to step 20.

Step 20:

Click Install to start the installer.

Step 21:

At about 86% complete, DBCA will kick in and create your database.

When that is done, you will need to run the root.sh script.

[root@localhost db_1]# ./root.sh
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

 
Step 22:
Make a note of the Enterprise Manager URL and click Close.

That’s it, Oracle 11.2.0.3 on CentOS 6.3 on VMware Workstation in two hours or less.

Advertisements

8 thoughts on “Installing Oracle 11.2.0.3 on CentOS 6.3 on VMware Workstation 8.

  1. when following your process, I keep having issues with step II. Specifically I get an error
    “error: File not found by glob: compat-libstdc++-33-3.2.3-69.el6.*.rpm
    error: File not found by glob: compat-libcap1-1.10-1.*.rpm”

    what am I missing?

    • Hi JoshK,

      Are you certain you have RHEL 6.0 and not a different release?

      You might have a slightly different version, and if so you can replace the version numbers with a wild card as follows:

      rpm -ivh compat-libstdc++-33-3.*.rpm
      rpm -ivh compat-libcap1-1.*.rpm

      If you have the full DVD distribution of RHEL or CentOS you should find all the RPMs you need in the Packages directory of the install media.

  2. Where did you download asm library and tools? Can you post the download link? I want to download ASM for CenOS 6.3

    • Oracle does not provide asmlib for RHEL6/CentOS6.

      Instead you need to use UDEV rules. These are shown in the post. ASMLib now requires the use of OEL for which Oracle wants payment.

      Gruff.

  3. Can we follow the above procedure when installing Oracle RAC too? Just confused since on your other procedure you told us to create independent disks but on this one you are asking us not to create independent ones. I’m not able to use your other RAC procedure since I’m trying it on RHEL6 and i’m stuck with oracle asm.

    • Matrix,

      To install RAC you will need to create independent persistent disks like the RAC guide shows, as well as a DNS server to handle SCAN.

      Remember to add the additional directives to the VMX file to support clustering.

      Since Oracle does not provide ASMLib for RHEL6, use UDEV rules instead.

      Gruff.

  4. Matrix,
    I can’t ping my listener 1521 port outside from linux
    Ora Err 12543 – what happen?

    /usr/sbin/lsof -i :1521
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    tnslsnr 51432 oracle 11u IPv4 223480 0t0 TCP vhcentos192.168.1.115:ncube-lm (LISTEN)

    tcpdump -i eth0 port 1521
    tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
    listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes

    18:48:56.853920 IP jmobob-xphp.axon-lm > vhcentos192.168.1.115.ncube-lm: Flags [S], seq 3692846405, win 64240, options [mss 1460,nop,nop,sackOK], length 0
    18:48:59.908900 IP jmobob-xphp.axon-lm > vhcentos192.168.1.115.ncube-lm: Flags [S], seq 3692846405, win 64240, options [mss 1460,nop,nop,sackOK], length 0
    18:49:05.815205 IP jmobob-xphp.axon-lm > vhcentos192.168.1.115.ncube-lm: Flags [S], seq 3692846405, win 64240, options [mss 1460,nop,nop,sackOK], length 0

    SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
    LISTENER =
    (ADDRESS_LIST =
    (ADDRESS =
    (PROTOCOL = IPC)
    (KEY = OR1.WORLD)
    )
    (ADDRESS=
    (PROTOCOL = IPC)
    (KEY = OR1)
    )
    (ADDRESS =
    (COMMUNITY = SAP.WORLD)
    (PROTOCOL = TCP)
    (HOST = 192.168.1.115)
    (PORT = 1521)
    )
    )
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = OR1)
    (ORACLE_HOME = /oracle/OR1/112_64)
    )
    )
    ADR_BASE_LISTENER = /oracle/OR1/saptrace

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s