Oracle 11gR2 and 12c Database on Linux / OEL / Fedora

Installing Oracle 11gR2 / 12c Database on Linux / Fedora

Oracle DB 11gR2 Installation needs some kernel parameters changing adding some new packages , so its a little tricky and i thought let me write this one to detail the installation process of Oracle 11gR2 Database on Linux Most Important : Select AL32UTF8 character set in the first screen of installer if you are planning to Install Oracle Fusion Middleware RCU Schemas

Softwares

You would need 2 zip files p10404530_112030_Linux-x86-64_1of7.zip and p10404530_112030_Linux-x86-64_2of7.zip , you can download this from www.oracle.com under database downloads, extract or unzip to a folder this creates 2 folders by names database , you would need to Merge these two folder without over writing each other

unzip p10404530_112030_Linux-x86-64_1of7.zip
unzip p10404530_112030_Linux-x86-64_2of7.zip

for 12c Database

unzip linuxamd64_12102_database_1of2.zip
unzip linuxamd64_12102_database_2of2.zip

Edit Host File

[root@james database]# sudo gedit /etc/hosts

your host file should should look something like this with the machine name added

127.0.0.1   localhost localhost.localdomain 
localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain 
localhost6 localhost6.localdomain6
192.X.Y.Z  james james-laptop

all the above in 2 lines

Edit Host File for FMW Install

[root@james database]# sudo gedit /etc/hosts

your host file should should look something like this with the machine name added

127.0.0.1   localhost localhost.localdomain 
localhost4 localhost4.localdomain4	
james  james-laptop
::1         localhost localhost.localdomain 
localhost6 localhost6.localdomain6
192.168.X.Y james

all the above in 3 lines

Run the Installer

First few screens are simple , just click next and next , give the password , the complications come when you see warnings

[james@james-laptop database]$ su
Password: 
[root@james-laptop database]# sudo gedit /etc/hosts

Edit Kernal Parameters

[root@james-laptop database]# sudo gedit /etc/sysctl.conf

Your parameters should look like this , you can copy paste if needed.

# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

#added by james below lines
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
kernel.shmmax = 4124653568

Save the Editor and close , set the Parameters

[root@james-laptop database]# /sbin/sysctl -p

Setting Hard and Soft Limits

[root@james-laptop database]# sudo gedit /etc/security/limits.conf

you can copy paste these lines in the Editor, Save and close

oracle        soft    nproc   2047
oracle        hard    nproc   16384
oracle        soft    nofile  4096
oracle        hard    nofile  65536
oracle        soft    stack   10240
*             soft    nproc   2047
*             hard    nproc   16384
*             soft    nofile  4096
*             hard    nofile  65536
*             soft    stack   10240

Now on the Installer Click on Check again button, you would see most Warnings gone , you can also try “Fix and Check again” that will ask you to execute a shell script as root, that should reduce few more warnings.

yum install glibc-headers
yum install glibc-devel
yum install gcc-c++
yum install gcc
[root@james DB11gR2]# rpm -ivh x86-compat-libs-7.2-1.i386.rpm
Preparing...                ################################# [100%]
1:x86-compat-libs        #################################### [100%]
[root@james DB11gR2]# rpm -ivh pdksh-5.2.14-1.i386.rpm
Preparing...                ################################# [100%]
1:pdksh                  #################################### [100%]

[root@james-laptop database]# cd /tmp/CVU_11.2.0.3.0_james/
[root@james-laptop CVU_11.2.0.3.0_james]# ./runfixup.sh 
Response file being used is :./fixup.response
Enable file being used is :./fixup.enable
Log file location: ./orarun.log
Setting Kernel Parameters...
kernel.shmmax = 536870912
kernel.shmmax = 4124653568

Missing Packages

During Operating System many packages might not be installed as required by Oracle Database , its required to add them

[root@james-laptop CVU_11.2.0.3.0_james]# 
yum install libaio
Loaded plugins: langpacks, presto, refresh-packagekit
....
Installed:
  libaio.x86_64 0:0.3.109-5.fc17           

Complete!
[root@james-laptop CVU_11.2.0.3.0_james]# 
yum install libaio-devel
Loaded plugins: langpacks, presto, refresh-packagekit
....
Installed:
  libaio-devel.x86_64 0:0.3.109-5.fc17                           

Complete!
[root@james-laptop CVU_11.2.0.3.0_james]# 
yum install elfutils-libelf-devel
Loaded plugins: langpacks, presto, refresh-packagekit
....

Installed:
  elfutils-libelf-devel.x86_64 0:0.154-2.fc17     

Complete!
[root@james-laptop CVU_11.2.0.3.0_james]# 
yum install sysstat
Loaded plugins: langpacks, presto, refresh-packagekit
...
Installed:
  sysstat.x86_64 0:10.0.3-2.fc17                         

Complete!

For 12c Database 
yum install ksh

Check again , some packages u might not be able to get using Yum installer , you would need to manually download the rpm and install

Download and Install rpm

Download compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm from here then Download pdksh-5.2.14-1.i386.rpm from here if these links get broken at some time , please do a google search for these rpms and download it Downloads folder and then install these rpms as shown below

[root@james-laptop Downloads]# 
rpm -ivh pdksh-5.2.14-1.i386.rpm 
Preparing...                
########################################### [100%]
   1:pdksh                  
########################################### [100%]
[root@james-laptop Downloads]# 
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm 
warning: compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm: 
Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                
########################################### [100%]
   1:compat-libstdc++-33    
########################################### [100%]

this should remove all warning messages , and move to next screen click Install to continue if you get any further warning message , just click on continue next

Run Configuration Scripts as root

you would be prompted to run few configuration scripts as root during installation

[root@james-laptop /]# cd /home/james/app/oraInventory/
[root@james-laptop oraInventory]# ./orainstRoot.sh 
Changing permissions of /home/james/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /home/james/app/oraInventory to james.
The execution of the script is complete.
[root@james-laptop oraInventory]# 
cd /home/james/app/james/product/11.2.0/dbhome_1/
[root@james-laptop dbhome_1]# ./root.sh
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= james
    ORACLE_HOME= /home/james/app/james/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: 
[/usr/local/bin]: /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.
Finished product-specific root actions.
[root@james-laptop dbhome_1]# 
....
This will complete the installation Process

login to Enterprise Manager

http://localhost:1158/em will be the default web url , if the installation should be correct then you should also be able to see EM page

Shell Script to Start Oracle Database

#!/bin/bash

echo "Starting Oracle 11g Database"
cd /home/james/app/james/product/11.2.0/dbhome_1/bin
echo "Current Directory"

pwd

export ORACLE_HOME=/home/james/app/james/product/11.2.0/dbhome_1
echo ORACLE_HOME=$ORACLE_HOME
export ORACLE_SID=orcl
echo ORACLE_SID=$ORACLE_SID
PATH=$PATH:/$ORACLE_HOME/bin
export PATH

sqlplus sys/welcome1 as sysdba <<ENDOFSQL
startup;
exit;
ENDOFSQL
emctl start dbconsole; lsnrctl start;

Startup script (dbstart.sh) for 12c Database

#!/bin/bash

echo "Starting Oracle 12c Database"
cd /home/oracle/app/oracle/product/12.1.0/dbhome_1/bin

pwd

export ORACLE_HOME=/home/oracle/app/oracle/product/12.1.0/dbhome_1
echo ORACLE_HOME=$ORACLE_HOME
export ORACLE_SID=orcl
echo ORACLE_SID=$ORACLE_SID
PATH=$PATH:/$ORACLE_HOME/bin
export PATH

sqlplus sys/welcome1 as sysdba <<ENDOFSQL
startup;
exit;
ENDOFSQL
emctl start dbconsole; lsnrctl start;

About the Author

Back to Comprehensive Solutions Author