Install Oracle 11G Release 2 (11.2) on Centos Linux 7

This article presents how to install Oracle 11G on Centos Linux 7.

Read following article how to install Centos Linux 7: Install Centos Linux 7 (for comfort set 2G memory for your virtual machine before proceeding with Oracle software installation).

Installation software is available on OTN, edelivery version 11.2.0.1 or Oracle support(old metalink) 11.2.0.4. In this installation I’m presenting installation for 11.2.0.4 but for previous version 11.2.0.X it shouldn’t be different.

Database software – 11.2.0.4

p13390677_112040_Linux-x86-64_1of7.zip 
p13390677_112040_Linux-x86-64_2of7.zip

OS configuration and preparation

OS configuration is executed as root. To login as root just execute following command in terminal.

su - root

Add groups

--required groups
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
Add user Oracle
/usr/sbin/useradd -u 502 -g oinstall -G dba,oper oracle

Change password for user

passwd oracle
Add kernel parameters to /etc/sysctl.conf
kernel.shmmni = 4096 
kernel.shmmax = 4398046511104
kernel.shmall = 1073741824
kernel.sem = 250 32000 100 128

fs.aio-max-nr = 1048576
fs.file-max = 6815744
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 = 1048586

Apply kernel parameters

/sbin/sysctl -p

Add following lines to set shell limits for user oracle in file /etc/security/limits.conf

oracle   soft   nproc    131072
oracle   hard   nproc    131072
oracle   soft   nofile   131072
oracle   hard   nofile   131072
oracle   soft   core     unlimited
oracle   hard   core     unlimited
oracle   soft   memlock  50000000
oracle   hard   memlock  50000000

The “/etc/hosts” file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1 centos7 centos7.dbaora.com localhost localhost.localdomain

Verify your network settings

[root@centos7 ~]# ping -c 1 centos7
PING centos7 (127.0.0.1) 56(84) bytes of data.
64 bytes from centos7 (127.0.0.1): icmp_seq=1 ttl=64 time=0.040 ms

--- centos7 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.040/0.040/0.040/0.000 ms

Modify .bash_profile for user oracle in his home directory

# Oracle Settings
export TMP=/tmp

export ORACLE_HOSTNAME=centos7.dbaora.com
export ORACLE_UNQNAME=ORA11G
export ORACLE_BASE=/ora01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=ORA11G

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'
alias envo='env | grep ORACLE'

umask 022

Check which packages are installed and which are missing

rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' binutils \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-common \
glibc-devel \
glibc-headers \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
sysstat \
unixODBC \
unixODBC-devel

In my case it returns following

binutils-2.23.52.0.1-16.el7(x86_64)
elfutils-libelf-0.158-3.el7(x86_64)
package elfutils-libelf-devel is not installed
gcc-4.8.2-16.el7(x86_64)
gcc-c++-4.8.2-16.el7(x86_64)
glibc-2.17-55.el7(x86_64)
glibc-common-2.17-55.el7(x86_64)
glibc-devel-2.17-55.el7(x86_64)
glibc-headers-2.17-55.el7(x86_64)
package ksh is not installed
libaio-0.3.109-12.el7(x86_64)
package libaio-devel is not installed
libgcc-4.8.2-16.el7(x86_64)
libstdc++-4.8.2-16.el7(x86_64)
libstdc++-devel-4.8.2-16.el7(x86_64)
make-3.82-21.el7(x86_64)
sysstat-10.1.5-4.el7(x86_64)
package unixODBC is not installed
package unixODBC-devel is not installed

Missing packages are on Centos 7 installation dvd. Other option if you are connected to internet is just use yum install command.

  • First option – just mount dvd and install missing packages using rpm -Uvh command from directory <mount dvd>/Packages.

In my case the directory is

/run/media/tomasz/CentOS 7 x86_64/Packages

NOTE – I’m using x86_64 version of packages

rpm -Uvh elfutils-libelf-devel*.x86_64.rpm
rpm -Uvh libaio-devel*.x86_64.rpm
rpm -Uvh unixODBC*.x86_64.rpm
rpm -Uvh ksh*.x86_64.rpm
  • Second option – use yum install command
yum -y install elfutils-libelf-devel
yum -y install libaio-devel
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install ksh

Create directory structure

mkdir -p /ora01/app
chown oracle:oinstall /ora01/app
chmod 775 /ora01/app

create ORACLE_BASE directory for oracle

mkdir -p /ora01/app/oracle
chown oracle:oinstall /ora01/app/oracle
chmod 775 /ora01/app/oracle

Create ORACLE_HOME directory for oracle

mkdir -p /ora01/app/oracle/product/11.2.0/db_1
chown oracle:oinstall -R /ora01/app/oracle

Disable secure linux by editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows. It requires REBOOT to be effective !!!

SELINUX=permissive

In Centos Linux 7 /tmp data is stored on tmpfs which consumes memory and is too small. To revert it back to storage just run following command and REBOOT machine to be effective.

systemctl mask tmp.mount

Install database software

Let’s start with database software installation as oracle user.

su - oracle

--unzip software 11.2.0.4
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip
--I defined 4 aliases in .bash_profile of user oracle to make 
--administration heaven :)

[oracle@centos7 ~]$ alias envo cdob cdoh tns
alias envo='env | grep ORACLE'
alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'

--run alias command envo to display environment settings
envo
ORACLE_UNQNAME=ORA11G
ORACLE_SID=ORA11G
ORACLE_BASE=/ora01/app/oracle
ORACLE_HOSTNAME=centos7.dbaora.com
ORACLE_HOME=/ora01/app/oracle/product/11.2.0/db_1

--run alias command cdob and cdoh to check ORACLE_BASE, ORACLE_HOME 
[oracle@centos7 ~]$ cdob
[oracle@centos7 oracle]$ pwd
/ora01/app/oracle

[oracle@centos7 db_1]$ cdoh
[oracle@centos7 db_1]$ pwd
/ora01/app/oracle/product/11.2.0/db_1

--run installation from install directory
./runInstall

1. Uncheck checkbox “I wish to receive security updates via My Oracle Support” and then click “Next” button.

2. Ignore following message and click “Yes” button.

3. Select “Skip software updates” and click “Next” button.

4. Select “Create and configure a database” then click “Next” button.

5. Select “Server Class” then click “Next” button.

6. Select “Single instance database installation” and click “Next” button.

7. Select “Typical Install” and click “Next” button.

8. Enter database name, administration password for user and click “Next” button.

9. Just click “Next” button.

10. Check checkbox “Ignore All” to ignore this error. Then click “Next” button.

dbs_oel7_11g_1

11. Just click “Yes” button to continue with installation.

12. Summary screen just before installation. Click “Install” button.

13. Boring installation …

14. I received following error during linking binaries

dbs_oel7_11g_2

To fix this error edit $ORACLE_HOME/sysman/lib/ins_emagent.mk, search for the line

 $(MK_EMAGENT_NMECTL)

and replace the line with

$(MK_EMAGENT_NMECTL) -lnnz11

then click “Retry” button

15. Database Configuration will start and create database for you.

16. You should see summary screen for your new database. Click “OK” button to continue with installation.

dbca_centos7_1

17. In the “middle” of installation you will be asked to run 2 scripts as user root. when scripts are executed just click “OK” button. Installation will proceed.

--execute scripts
/ora01/app/oraInventory/orainstRoot.sh
/ora01/app/oracle/product/11.2.0/db_1/root.sh

18. Installation completed. Just click “Close” button.

dbca_centos7_2

19.You should see all details about new database in database console

centos7_11g_em1

Post installation steps

Edit the “/etc/oratab” file to set restart flag for ORA11G to ‘Y’.

ORA11G:/u01/app/oracle/product/11.2.0/db_1:Y

Useful commands

All commands should be executed as user oracle

  • check status, start, stop dbconsole
emctl status dbconsole
emctl start dbconsole
emctl stop dbconsole
  • check status, start, stop listener
lsnrctl status LISTENER
lsnrctl start LISTENER
lsnrctl stop LISTENER

Have a fun 🙂

Tomasz

44 thoughts on “Install Oracle 11G Release 2 (11.2) on Centos Linux 7

  1. Very good and detailed installation tutorial. Thank you very much! i had not found the solution of error in internet altough i search many hours when i install Oracle in Centos 7. thank you very much again.

  2. I have successfully been through all your instructions right up to the point of running the GUI installer. Now unfortunately linux is complaining about not being able to open the display. Something to do with X11. I’m assuming this is something to do with the fact that I’m running this on a Mac using Parallels, but it’s just a guess. I’m a linux novice who just wants to get a database up and running so if you can help can you dumb down your instructions for me please.

  3. OK – this is what I get after running your command as root and then switching to oracle for the installer.

    [[oracle@localhost database]$ ./runInstaller
    Starting Oracle Universal Installer…

    Checking Temp space: must be greater than 120 MB. Actual 42969 MB Passed
    Checking swap space: must be greater than 150 MB. Actual 2015 MB Passed
    Checking monitor: must be configured to display at least 256 colors
    >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<>> Ignoring required pre-requisite failures. Continuing…
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-01-23_04-16-10PM. Please wait …
    DISPLAY not set. Please set the DISPLAY and try again.
    Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
    – For csh: % setenv DISPLAY 192.168.1.128:0.0
    – For sh, ksh and bash: $ DISPLAY=192.168.1.128:0.0; export DISPLAY
    Use the following command to see what shell is being used:
    echo $SHELL
    Use the following command to view the current DISPLAY environment variable setting:
    echo $DISPLAY
    – Make sure that client users are authorized to connect to the X Server.
    To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
    % xhost +
    To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as ‘xclock’:
    %
    If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
    Typical path for xclock: /usr/X11R6/bin/xclock
    [oracle@localhost database]$

  4. I’m getting this error:

    INFO: gcc -o ctxhx -m64 -L/u01/app/oracle/product/11.2.0/db_1/ctx/lib/ -L/u01/app/oracle/product/11.2.0/db_1/lib/ -L/u01/app/oracle/product/11.2.0/db_1/lib/stubs/ /u01/app/oracle/product/11.2.0/db_1/ctx/lib/ctxhx.o -L/u01/app/oracle/product/11.2.0/db_1/ctx/lib/ -lm -lsc_fa -lsc_ex -lsc_da -lsc_ca -lz -lctxhx -Wl,-rpath,/u01/app/oracle/product/11.2.0/db_1/ctx/lib -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -lsnls11 -lnls11 -lcore11 -lnls11 `cat /u01/app/oracle
    INFO: /product/11.2.0/db_1/lib/sysliblist`

    INFO: /lib64/libstdc++.so.5: undefined reference to `memcpy@GLIBC_2.14′

    INFO: collect2: error: ld returned 1 exit status

    INFO: make: *** [ctxhx] Error 1

    INFO: End output from spawned process.
    INFO: ———————————-
    INFO: Exception thrown from action: make
    Exception Name: MakefileException
    Exception String: Error in invoking target ‘install’ of makefile ‘/u01/app/oracle/product/11.2.0/db_1/ctx/lib/ins_ctx.mk’. See ‘/u01/app/oraInventory/logs/installActions2015-04-13_05-12-25PM.log’ for details.
    Exception Severity: 1

    • In my case:

      binutils-2.23.52.0.1-30.el7_1.1(x86_64)
      elfutils-libelf-0.160-1.el7(x86_64)
      elfutils-libelf-devel-0.160-1.el7(x86_64)
      gcc-4.8.3-9.el7(x86_64)
      gcc-c++-4.8.3-9.el7(x86_64)
      glibc-2.17-78.el7(x86_64)
      glibc-common-2.17-78.el7(x86_64)
      glibc-devel-2.17-78.el7(x86_64)
      glibc-headers-2.17-78.el7(x86_64)
      ksh-20120801-22.el7(x86_64)
      libaio-0.3.109-12.el7(x86_64)
      libaio-devel-0.3.109-12.el7(x86_64)
      libgcc-4.8.3-9.el7(x86_64)
      libstdc++-4.8.3-9.el7(x86_64)
      libstdc++-devel-4.8.3-9.el7(x86_64)
      make-3.82-21.el7(x86_64)
      sysstat-10.1.5-7.el7(x86_64)
      unixODBC-2.3.1-10.el7(x86_64)
      unixODBC-devel-2.3.1-10.el7(x86_64)

  5. Thanks for such a great effort. I think you missed some thing to mention over here and that is after starting installation procedure when it checks for the packages there it require some i386 packages those are not available on the centos 7 neither on centos 6. I downloded these packages from the centos 4.4 that works.

    Well I really appreciate the way you define every steps it helps me a lot though I am a new to oracle database server installation.

  6. Guys i don’t know what I have done wrong but after following all the steps before reboot. I’m unable to boot into virtual machine on virtual box..is it just me or anyone else had the same issue please help this is second time i’m trying to install oracle on my virtual box and and after the reboot before installing the database i’m unable to boot into virtual machine. any help will be appreciated.

    thanks

  7. i don’t know if it is too late , or the admin will read this or not , just want to say that the topic and the explanation are perfect , it is a great job.
    and i have a question, what are the required packages for asm installation?
    would you add a note if you have time
    thanks

  8. When I run command “alias envo cdob cdoh tns” getting an this error:
    -bash: alias: envo: not found
    -bash: alias: cdob: not found
    -bash: alias: cdoh: not found
    -bash: alias: tns: not found
    Please help me fix it.

  9. Thanks Tomasz
    but i have error if i skip update or on step 3
    “the message is Verifying setup for installer validations” but have loading more fore 2 hours,why are yo know that?

    Thanks…

  10. Pingback: Business Intelligence LAB

  11. i am stuck at two errors…
    1. I have all the packages installed still it is showing me “Failed” on those packages.
    2. I have set the kernel parameters as by the instructions still it says “kernel semmni” is not correct. Here is the link to the thread i asked this question but the solution was not satisfactory.
    https://community.oracle.com/thread/4100503

  12. Hello,
    Thank you for the post. I need to automate these installation. Is it possible to use only cmd console behind the GUI ?
    Thank you.

    • Yes it’s possible to install using cmd line just look on silent installation for other systems. It’s the same.
      Regards
      Tomasz

  13. i dont have a runInstall fiel in my installation directory.. is this file will come by running commands od is the zip is not extracted properly.. can you please let me know if you know the solution for the issue.. Thank you

  14. Hello,

    I did everything according to this page.
    The services are started after installation and access the normal portal without any errors. When I reboot the machine nothing works. Can someone help me?

  15. hello
    thanks for this great tuto and clarity .
    i have one question : how can i increase the number of processes and sessions for my instance to allow the application and client connect without problem of saturation .
    thanks for reply

    • Saturation on what level memory ? There is no golden tutorial here.
      In 11G you can’t control fully memory that end users can use.
      They can overused PGA memory unless you use 12C with pga_aggregate_limit.
      Also it depends what we are talking about OLAP or Warehouse and so on and so on …

      Regards
      Tomasz

  16. Pingback: Oracle安装详解 – JUST DO IT

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.