Oracle Database 11g Release 2 Installation on RHEL/CentOS 6.x/5.x/4.x

As we all know Oracle database is the most popular and widely used Relational Database Management System (RDBMS) in the world. This post describes step by step installation of Oracle Database 11g Release 2 32bit on CentOS 6.4 32bit. The installation steps should not be vary on most of the Red Hat based Linux distributions.

Installing Oracle Database 11g Release 2

Step 1: Install Oracle Dependencies

We use “oracle-rdbms-server-11gR2-preinstall” package offered by “Oracle Public Yum” repository. The Oracle public yum repository provides a free and easiest way to install all the latest Oracle Linux dependencies automatically. To setup yum repository, follow the instructions provided below.

Use “wget” command to Download appropriate yum configuration file under /etc/yum.repos.d/ directory as root user.

RHEL/CentOs 6.x
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-ol6.repo
RHEL/CentOs 5.x
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-el5.repo
RHEL/CentOs 4.x
# cd /etc/yum.repos.d
# wget https://public-yum.oracle.com/public-yum-el4.repo

Now perform the following “yum” command to install all the necessary prerequisites automatically.

[[email protected]]# yum install oracle-rdbms-server-11gR2-preinstall

While importing GPG key, you might get “GPG key retrieval failed” error as shown below. Here, you need to import proper GPG key for your OS release.

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

Download and verify the appropriate Oracle Linux GPG Key that best matches your RHEL/CentOS compatible OS release.

RHEL/CentOs 6.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
RHEL/CentOs 5.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
RHEL/CentOs 4.x
# wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el4 -O /usr/share/rhn/RPM-GPG-KEY-oracle

Step 2: Setting Hostname

Open the “/etc/sysconfig/network” file and modify the HOSTNAME to match your FQDN (Fully Qualified Domain Name) host name.

[[email protected]]# vi /etc/sysconfig/network
HOSTNAME=oracle.tecmint.com

Open “/etc/hosts” file and add fully qualified hostname for the server.

[[email protected]]# vi /etc/hosts
192.168.246.128		oracle.tecmint.com		oracle

Now you need to restart networking on the server to make sure that changes will be persistent on reboot.

[[email protected]]# /etc/init.d/network restart

Step 3: Oracle User Settings

Set the password for the “oracle” user.

[[email protected]]# passwd oracle

Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.

Add the entry to file “/etc/security/limits.d/90-nproc.conf” as described below.

[[email protected]]# vi /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     1024
# To this
* - nproc 16384

Set SELinux to “permissive” mode by editing the file “/etc/selinux/config“.

[[email protected]]# vi /etc/selinux/config
SELINUX=permissive

Once you’ve made change, don’t forger to restart the server to reflect new changes.

[[email protected]]# reboot

Login as Oracle user and open file “.bash_profile“, which is available on oracle user’s home directory, make an entries as described below. Make sure you set correct hostname to “ORACLE_HOSTNAME=oracle.tecmint.com“.

[[email protected]]# su oracle
[[email protected] ~]$ vi .bash_profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=oracle.tecmint.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

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

Switch to root user and issue the following command to allow Oracle user to access X Server.

[[email protected]]# xhost +

Create the directories and set the appropriate permissions in which the Oracle software will be installed.

[[email protected]]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
[[email protected]]# chown -R oracle:oinstall /u01
[[email protected]]# chmod -R 775 /u01

Step 4: Downloading Oracle Software

Sign-up and Download the Oracle software using the following link.

  1. Oracle Database 11g Release 2
Download Oracle 11g Release 2
Download Oracle 11g Release 2

The Oracle package contains 2 zip files which you must first accept the license agreement before downloading. I’ve given the files names for you reference, please download these files for your system architecture somewhere under “/home/oracle/“.

For Linux x86 Systems
http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_1of2.zip
http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_database_2of2.zip
For Linux x86-64 Systems
http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip
http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

Step 5: Oracle Installation

Now let’s start Oracle installation. First of all need to switch as ‘oracle’ user to install database.

[[email protected] ~]$ su oracle

Extract compressed Oracle database source files to the same directory “/home/oracle/“.

[[email protected] ~]$ unzip linux_11gR2_database_1of2.zip

[[email protected] ~]$ unzip linux_11gR2_database_2of2.zip

Post unzip source file, directory called database will be created, go to inside the directory and execute below script to start Oracle database installation process.

[[email protected] database]$ cd database

[[email protected] database]$ ./runInstaller

1. RunInstaller will call Oracle Universal Installer (OUI), wherein look and feel & steps are the same across all the operating system.

Oracle Universal Installer
Oracle Universal Installer

2. Provide your email address to be informed of security issues and receive security updates.

Configure Security Updates
Configure Oracle Security Updates

3. Create and Configure a Database

Create Oracle Database
Create Oracle Database

4. Choose the system class, either Desktop or Server.

Select System Class
Select Oracle System Class

5. Select the type of database installation you want to perform.

Oracle Node Selection
Select Database Installation Type

6. Select “Typical install” option to install full oracle installation with basic configuration.

Select Oracle Install Type
Select Typical Install

7. Set Administrative password and perform full Database installation with basic configuration.

Oracle Typical Installation Configuration
Set Oracle Administrative Password

8. Please click on “Yes” to continue with installation.

Oracle Typical Install Configuration
Typical Install Configuration Confirm

9. Create Inventory

Create Oracle Inventory
Create Inventory

10. If you faced prerequisites warning during installation. Click on “Fix & Check Again“. Oracle fixes Prerequisites by itself. This is the new feature of Oracle Database 11g.

Perform Prerequisite Checks
Perform Prerequisite Checks

The pdksh package is not available in Oracle repository due to which you need to download and install it manually.

[[email protected]]# wget ftp://rpmfind.net/linux/redhat-archive/6.2/en/os/i386/RedHat/RPMS/pdksh-5.2.14-2.i386.rpm

During pdksh package installation you may encountered conflict error of ksh package. Remove ksh package forcefully and install the pdksh package with given below command:-

[[email protected]]# rpm -e ksh-20100621-19.el6_4.4.i686 --nodeps
[[email protected]]# rpm -ivh pdksh-5.2.14-2.i386.rpm

11. Performing Prerequisite checks: It’s test whether sufficient total SWAP space is available on the system.

Performing Prerequisite SWAP Check
Performing Prerequisite SWAP Check

12. Installation Summary: Click on Save Response File. This file is useful for Oracle Silent Mode Installation

Oracle Installation Summary
Oracle Installation Summary

13. Save Response File somewhere in your system.

Save Response File
Save Response File

14. Product Installation Progress

Install Oracle Product
Product Install

15. Copying database files

Copying Database Files
Copying Database Files

16. Click on “Password Management“.

Oracle Password Management
Oracle Password Management

17. Set password for user “SYS” and click on OK to continue.

Set SYS User Password
Set SYS User Password

18. Configuration scripts need to be executed as the “root” user. Go to the path given in the screen and execute the scripts one by one. Click on ‘OK‘ once scripts is executed.

Execute Configuration Scripts
Execute Configuration Scripts
[[email protected]]# cd /u01/app/oraInventory
[[email protected] 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.
[[email protected]]# cd /u01/app/oracle/product/11.2.0/dbhome_2/
[[email protected] dbhome_2]# ./root.sh
Running Oracle 11g root.sh script...

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

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.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

19. The installation of Oracle Database is successful.

Oracle Installation Completed
Oracle Installation Finish

20. To test your Oracle installation navigate to web based management interface for your system at “localhost” with the user name “SYS” connecting as “SYSDBA” and using the password you set during the install of Oracle. Remember to open port 1158 on your firewall and restart the iptables service.

[[email protected]]# iptables -A INPUT -p tcp --dport 1158 -j ACCEPT
[[email protected]]# service iptables restart
https://localhost:1158/em/
Oracle Enterprise Manager Login
Oracle Enterprise Manager Login

21. Oracle Enterprise Database Control Manager

Oracle Database Control Manager
Oracle Database Control Manager

Now you can start using Oracle. I highly recommend you to follow the Oracle Documentation for more help. There are number of client applications out there which can help you, like the command line tool called Oracle Instant Client and the Oracle SQL Developer UI program.

This is end of the Oracle Database Software Installation. In our upcoming article we will be covering how to create database using DBCA and how to Start-up and Shutdown Oracle Database. Please stay tuned…!!!

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

69 thoughts on “Oracle Database 11g Release 2 Installation on RHEL/CentOS 6.x/5.x/4.x”

  1. ./runInstaller -silent -force -responsefile /home/oracle/database/response/db_install.rsp
    INFO: Setting variable ‘ROOTSH_LOCATION’ to ‘/u01/app/oracle/product/11.2.0.4/db_1/root.sh’. Received the value from a code block.
    INFO: Setting variable ‘ROOTSH_LOCATION’ to ‘/u01/app/oracle/product/11.2.0.4/db_1/root.sh’. Received the value from a code block.
    INFO: InstallProgressMonitor: Starting phase 2
    INFO: Installation in progress
    INFO: Installation in progress
    INFO: Extracting files to ‘/u01/app/oracle/product/11.2.0.4/db_1’.
    INFO: Extracting files to ‘/u01/app/oracle/product/11.2.0.4/db_1’.
    INFO: Performing fastcopy operations based on the information in the file ‘oracle.server_EE_exp_1.xml’.
    INFO: Performing fastcopy operations based on the information in the file ‘racfiles.jar’.
    INFO: Performing fastcopy operations based on the information in the file ‘oracle.server_EE_dirs.lst’.
    INFO: Performing fastcopy operations based on the information in the file ‘oracle.server_EE_filemap.jar’.
    INFO: Performing fastcopy operations based on the information in the file ‘oracle.server_EE_1.xml’.
    INFO: Performing fastcopy operations based on the information in the file ‘setperms1.sh’.
    INFO: Number of threads for fast copy :1
    INFO: invalid distance code
    SEVERE: oracle.sysman.oii.oiif.oiifb.OiifbEndIterateException: invalid distance code
    at oracle.sysman.oii.oiic.OiicInstallAPISession.doOperation(OiicInstallAPISession.java:490)
    at oracle.sysman.oii.oiic.OiicAPIInstaller.doOperation(OiicAPIInstaller.java:1010)
    at oracle.sysman.oii.oiic.OiicAPIInstaller.doOperation(OiicAPIInstaller.java:971)
    at oracle.install.driver.oui.OUISetupDriver.setup(OUISetupDriver.java:459)
    at oracle.install.driver.oui.SetupJob.call(SetupJob.java:178)
    at oracle.install.driver.oui.SetupJob.call(SetupJob.java:52)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
    at java.util.concurrent.FutureTask.run(FutureTask.java:123)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:662)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:688)
    at java.lang.Thread.run(Thread.java:637)

    INFO: Update the state machine to STATE_READY
    INFO: isSuccessfullInstallation: false
    INFO: isSuccessfullRemoteInstallation: true
    INFO: Adding ExitStatus FAILURE to the exit status set
    INFO: Shutting down OUISetupDriver.JobExecutorThread
    SEVERE: [FATAL] invalid distance code
    CAUSE: No additional information available.
    ACTION: Refer to the logs or contact Oracle Support Services
    SUMMARY:
    – invalid distance code.
    Refer associated stacktrace #oracle.install.commons.util.exception.DefaultErrorAdvisor:6214
    INFO: Advice is ABORT
    SEVERE: Unconditional Exit
    INFO: Adding ExitStatus FAILURE to the exit status set
    INFO: Adding ExitStatus SUCCESS_WITH_WARNINGS to the exit status set
    INFO: Finding the most appropriate exit status for the current application
    INFO: Exit Status is -1
    INFO: Shutdown Oracle Database 11g Release 2 Installer

    pls help

    Reply
  2. I tried installing on Cent0S 6.6, Getting below error at 6th step of installation :

    [INS-32021 ]Insufficient disk space on this volume for selected Oracle home
    

    Output of df -h looks like :

    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda2        18G   14G  3.1G  82% /
    
    Reply
  3. Excellent, I installed it on CentOS 6.8 and this step by step work correctly.

    Congratulations on this article.

    Regards,
    Hugo González
    Caracas,
    Venezuela

    Reply
    • @Julio,

      The repository is working fine, I just checked the repo and its showing the content as:

      [ol6_latest]
      name=Oracle Linux $releasever Latest ($basearch)
      baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
      gpgcheck=1
      enabled=1
      
      [ol6_addons]
      name=Oracle Linux $releasever Add ons ($basearch)
      baseurl=http://yum.oracle.com/repo/OracleLinux/OL6/addons/$basearch/
      gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
      gpgcheck=1
      enabled=0
      ...
      
      Reply
  4. Hello Sir,

    if we choose the option of Install software only at during the installation of Oracle 11G data base after which command is used to create the database.

    Can you help to sort out my query.

    Reply
  5. Hi narad,

    I am getting the dependency errors while installing Oracle 11g on CentOS 7
    can you help me how to solve these issues

    Thanks in advance

    Reply
    • @Raju,

      What dependency errors you getting on the screen while installing Oracle 11g? could you share the error output with us? so that we can help you out.

      Reply
  6. Hello Everyone.

    Good day.

    I am new to Oracle and I am on the way of installing Oracle Database 12C. I would like just like to know if the files that I have download [linuxamd64_12c_database_1of2.zip and linuxamd64_12c_database_2of2.zip ] can be also installed in the Linux Server RHEL 6.7 just all using all the terminal? Because what I saw in the internet is that they do it in the terminal and then after some configurations, there will be a GUI for to continue the installation.. With my case, I am just connecting to server located remotely using ssh..

    Please advise.

    Thanks in advance for the help

    Reply

Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.

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