Silent Install of Oracle 11.2.0.3 on RedHat 6.0.

In this blog post, we are going to silently install Oracle 11.2.0.3 64-bit on RedHat 6.0 using VMWare Workstation 8.

This install demonstration is going to use the silent install mode for all components. At least within the guest VM, at no point will we use a GUI for the install. We will need to use the VMWare GUI to create the VM, install the OS and add disks.

With the increasing use of VMWare, many organizations are looking to automate the deployment of Oracle database environments for development, test or validation. And increasingly DBAs are being tasked with automating the provisioning process.

Note that even though Oracle provides “silent” install options for all of the installer programs, many of them still need a functioning graphic display. The installer programs are not able to disable the sub-routines that would typically render the GUI, and so they will fail if the Linux environment does not include a display. If need to install in an environment where there is no display, you can set the environment DISPLAY variable to another X-host or VNC server.

Whereas this demonstration is not completely automated, it might form the basis of a fully scripted database deployment model for non-production use.

Note: This blog post recycles a good deal of material from the Installing Oracle 11.2.0.3 on CentOS 6.3 on VMWare Workstation 8 post, but shows how to do the install silently. The target OS in this sample was RedHat 6.0.

Time Required: 70 minutes

Class Materials:

  • An x86 64-bit computer with 2GB RAM and 10GB 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 RedHat 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
RedHat 6.0 64-bit RedHat Linux 6.0 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 RedHat VM.

Time Required: 10 mins.

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

I created my VM with 2GB RAM and a single 60GB SCSI disks.

 

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.148-1.el6.x86_64.rpm \
 elfutils-libelf-devel-0.148-1.el6.x86_64.rpm \
 gcc-c++-4.4.4-13.el6.x86_64.rpm \
 glibc-2.12-1.7.el6.i686.rpm \
 glibc-devel-2.12-1.7.el6.i686.rpm \
 libaio-devel-0.3.107-10.el6.x86_64.rpm \
 libaio-0.3.107-10.el6.i686.rpm \
 libgcc-4.4.4-13.el6.i686.rpm \
 libstdc++-devel-4.4.4-13.el6.x86_64.rpm \
 libtool-ltdl-2.2.6-15.5.el6.i686.rpm \
 nss-softokn-freebl-3.12.7-1.1.el6.i686.rpm \
 readline-6.0-3.el6.i686.rpm \
 ncurses-libs-5.7-3.20090208.el6.i686.rpm \
 libcap-2.16-5.2.el6.i686.rpm \
 libattr-2.4.44-4.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/RHEL_6.0 x86_64 Disc 1/Packages"

 
RedHat should respond with:

warning: compat-libstdc++-33-3.2.3-69.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: 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:compat-libcap1         ########################################### [ 47%]
  10:libaio                 ########################################### [ 53%]
  11:ncurses-libs           ########################################### [ 58%]
  12:libattr                ########################################### [ 63%]
  13:libcap                 ########################################### [ 68%]
  14:readline               ########################################### [ 74%]
  15:compat-libstdc++-33    ########################################### [ 79%]
  16:libtool-ltdl           ########################################### [ 84%]
  17:compat-libcap1         ########################################### [ 89%]
  18:libaio-devel           ########################################### [ 95%]
  19:glibc-devel            ########################################### [100%]

 

If you want the pdksh RPM then you will have to download it from the web. I downloaded it from ftp.pbone.net. RedHat 6.0 has all the required supporting packages for it.

[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 RedHat 6.0 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. We will also disable the NTP time synchronization configuration file which will confuse the Oracle installer.

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

# added for Oracle 11.2.0.3
kernel.shmall = 2097152
kernel.shmmax = 1050470400
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

 
Disable the NTP configuration file

[root@localhost ~]# cd /etc
[root@localhost etc]# mv ntp.conf ntp.conf.bak

 
Now we have the RedHat 6.0 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:

LD_BIND_NOW=1; export LD_BIND_NOW
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 provide 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
36000c29721f0ef917cf4b6179923ed12

 
So the SCSI identifier of the new disk is 36000c29721f0ef917cf4b6179923ed12. 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=="36000c29721f0ef917cf4b6179923ed12", NAME="oracleasm/asm-disk1", 
OWNER="oracle", GROUP="dba", MODE="0660"

 
In the above example we have instructed RedHat to create an alias called /dev/oracleasm/asm-disk1 when it finds the SCSI ID 36000c29721f0ef917cf4b6179923ed12. 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: 5 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. Since we are going to install the Grid in silent mode, we need a response file. The response file will provide instructions to the installer program on how we want Oracle 11.2.0.3 Grid configured.

Change into the grid directory and launch the runInstaller script as follows:

[oracle@localhost grid]$ ./runInstaller -silent -force -responseFile $HOME/grid.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 50568 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4031 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-01-10_08-16-23AM. Please wait ...[oracle@localhost grid]$ You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2013-01-10_08-16-23AM.log
The installation of Oracle Grid Infrastructure was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2013-01-10_08-16-23AM.log' for more details.

As a root user, execute the following script(s):
	1. /u01/app/oraInventory/orainstRoot.sh
	2. /u01/app/11.2.0/grid/root.sh


Successfully Setup Software.

[oracle@localhost grid]$

 
At the conclusion of the install, we will need to log in as root as execute the two scripts shown.

Note that in my response file I have selected to install only the software, and not create a Grid infrastructure by setting the following option:

oracle.install.option=CRS_SWONLY

 
Other important directives in the response file include:

INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/11.2.0/grid

 

The interested DBA should examine the grid response file in detail before selecting this method of install, and be comfortable with all the directives being used.

My complete grid.rsp file can be found here: grid.rsp. WordPress does not allow straight text files to be uploaded, so the extension is DOC, although it is a raw ASCII text file.

 

Part VII – Install Database.

Time Required: 5 mins.

Next we will install the Database home.

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. Since we are going to install the Database in silent mode, we need a response file. The response file will provide instructions to the installer program on how we want Oracle 11.2.0.3 Database software configured.

Change into the database directory and launch the runInstaller script as follows:

[oracle@localhost database]$ ./runInstaller -silent -force -responseFile $HOME/db.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 47617 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4023 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-01-10_11-26-40AM. Please wait ...
You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2013-01-10_11-26-40AM.log

The installation of Oracle Database 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2013-01-10_11-26-40AM.log' for more details.

As a root user, execute the following script(s):
	1. /u01/app/oracle/product/11.2.0/dbhome_1/root.sh


Successfully Setup Software.

[oracle@localhost database]$

 

At the conclusion of the install we need to log in as root and execute the /u01/app/oracle/product/11.2.0/dbhome_1/root.sh script.

My complete db.rsp file can be found here: db.rsp. WordPress does not allow straight text files to be uploaded, so the extension is DOC, although it is a raw ASCII text file.

 

Part VIII – Configure Standalone ASM/GI.

Time Required: 2 mins.

We have now configured RedHat 6.0 for Oracle 11.2.0.3 and installed both Grid and Database in software-only mode. Now would be a good time to make a full backup of your VM. It is very simple to change the VM’s hostname and IP address since we not configured the Grid components or Listener yet. You can clone and deploy the template as often as you like setting new hostnames and IP addresses each time. This is also a good method if the storage at the time of deployment is not known. It might be VMFS based virtual LUNs, or it might be RDM LUNs from an array. Indeed you might even choose NFS for some less performance demanding tasks.

The Grid infrastructure must be configured from the root account, and with the ORACLE_HOME variable set to the location of the Grid software:

[root@localhost ~]# $ORACLE_HOME/perl/bin/perl -I \
  $ORACLE_HOME/perl/lib -I \
  $ORACLE_HOME/crs/install $ORACLE_HOME/crs/install/roothas.pl
Using configuration parameter file: /u01/app/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     2013/01/10 15:06:48     /u01/app/11.2.0/grid/cdata/localhost/backup_20130110_150648.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

 

Part IX – Configure Listener.

Time Required: 1 min.

At this point it is good idea to create a listener under the Grid Infrastructure home. We can do this as follows:

[oracle@localhost grid]$ netca -silent -responsefile $ORACLE_HOME/assistants/netca/netca.rsp

Parsing command line arguments:
    Parameter "silent" = true
    Parameter "responsefile" = /u01/app/11.2.0/grid/assistants/netca/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
    Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0

 

Part X – Create ASM Instance and Diskgroup.

Time Required: 2 mins.

In the next step, we will create an ASM instance under the Grid Infratsructure home, as well as create an initial DATA diskgroup. Make sure the ORACLE_HOME variable is set to the location of the Grid install.

In the following example we use the /dev/oracleasm/asm-disk1 disk presented by UDEV. We set the compatibility to 11.2.0.0.0 for the ASM diskgroup we are creating.

It is important we specify the diskString parameter and point it at the /dev/oracleasm/* directory.

[oracle@localhost grid]$ asmca -silent -configureASM \
  -sysAsmPassword mypassword \
  -asmsnmpPassword mypassword \
  -diskGroupName DATA \
  -diskList '/dev/oracleasm/asm-disk1' \
  -redundancy EXTERNAL \
  -au_size 1 \
  -compatible.asm '11.2.0.0.0' \
  -compatible.rdbms '11.2.0.0.0' \
  -diskString '/dev/oracleasm/*'

ASM created and started successfully.

Disk Group DATA created successfully.

 
The ASM instance is now running.
 

Part XI – Create a Database.

Time Required: 5 mins.

In the last section we create a database from the DBCA template General Purpose. In this example we set the SYSTEM and SYSDBA passwords to mypassword, use ASM diskgroup DATA for our data files and name the dataabse gctdev.

Sample schemas are also loaded into our new database, which will register with the local listener LISTENER.

dbca -silent \
  -createDatabase \
  -asmsnmpPassword mypassword \
  -characterSet WE8ISO8859P15 \
  -continueOnNonFatalErrors false \
  -disableSecurityConfiguration ALL \
  -diskGroupName DATA \
  -emConfiguration NONE \
  -gdbName gctdev.local \
  -listeners LISTENER \
  -memoryPercentage 40 \
  -recoveryAreaDestination DATA \
  -sid gctdev \
  -SysPassword mypassword \
  -SystemPassword mypassword \
  -storageType ASM \
  -sampleSchema true \
  -templateName General_Purpose.dbc

Copying database files
1% complete
3% complete
10% complete
17% complete
24% complete
35% complete
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Restart
64% complete
Completing Database Creation
68% complete
71% complete
75% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/gctdev/gctdev.log" for further details.

 
And that is it – the database install is now complete! And we hardly touched a GUI at all 🙂

Advertisements

6 thoughts on “Silent Install of Oracle 11.2.0.3 on RedHat 6.0.

  1. Hi,
    its a nice one. while creating asm instance & diskgroup if we have marked disk with asmca then how to provide the disk list? will it be like this ‘ORCL:asm-disk1’ ?

    Regards,
    Surya

    • Hi Surya,

      If you use the command “kfod di=asm” you will see your disks marked by asmca.

      If you use ASMLib you see them as “ORCL:”. If you use UDEV rules they will show up as /dev/oracleasm/ or whatever path you specified in your udev rules.

      HTH.

      Gruff

  2. I had issues running netca as described above…
    Here is what worked for me…
    netca /silent /responsefile $ORACLE_HOME/assistants/netca/netca.rsp

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