Setting Up Prerequisites for Oracle 12c Installation in RHEL/CentOS/Oracle Linux 6.5 – Part I

Oracle database is the set of related data collections, we can call it as Relational database management system (RDBMS) or just Oracle. While comparing to any other database solution oracle is one of the powerful DBMS with many features such as tune-able, reliable and scalable. Oracle produce separate hardware for oracle software’s, but same can be used in any other vendor products too.

Update: How to Install Oracle Database 12c on RHEL/CentOS 7

In 1977 Larry Ellison and his friends founded a software development system as oracle. In 1978 Oracle released its 1st version and later in 1979 they released the version 2 which was commercially used. The current version of oracle is 12c (C stands for Cloud) with cloud features. Oracle provides several supports regarding the products which includes troubleshooting supports patches and updates, which makes it rock solid, because it is very easy to organize different applications data. While comparing to any other database management Oracle is costly and mostly used for commercial purpose, almost everywhere, e.g: Banking, Universities for results, commerce related departments etc.

Oracle supports almost every operating systems such as Linux, HP-UX, AIX, Oracle Solaris, IBM zLinux64, and Windows. Oracle packages are available for both 32bit and 64bit platforms.

Requirements

  1. For large-scale installation we need to use multicore processors with High availability.
  2. Recommended minimum RAM needed for Oracle is 2GB or more.
  3. Swap must be enabled double the size of RAM.
  4. Disk space must be more than 8GB, its depends on edition which are we going to choose for installing.
  5. /tmp directory must have free space more than 1GB for error free installation.
  6. Supported Linux operating systems are RHEL, Centos, Oracle.
  7. Both x86_64 and i686 packages are required for installation.
  8. Screen resolution must be more than 1024×768 resolution.

If your systems meets all the above requirements, then we are ready to move forward to start oracle installation. Please remember, here I am using CentOS 6.5 operating system with 32GB size of Virtual HDD and 4GB Memory for installation, but same steps can also be followed in RHEL, Oracle Linux too.

My Testing Environment
IP Address	:	192.168.0.100
Host-name	:	oracle12c.tecmint.local
OS		:	Centos 6.5 Final

Note: I’ve used ‘tecmint‘ user with sudo privileges for this Oracle installation, but I strongly recommend you to use root login for all below installation instructions.

Step 1: Setting Hostname and Upgrading System

1. Before, heading up for the installation process, first makes sure your / and /tmp partitions has enough available space to carry error free installation.

$ df -h

2. Next, verify that your system has correct hostname, static IP address and distribution version, using following commands.

$ hostname
$ ifconfig | grep inet
$ lsb_release -a
Verify System Details
Verify System Details

3. If you’ve not set your system hostname, edit the system hosts file ‘/etc/hosts‘ and enter your hostname entry along with IP address as shown below.

$ vim /etc/hosts

127.0.0.1       localhost  oracle12c.tecmint.local
192.168.0.100   oracle12c.tecmint.local
Set System Hostname
Set System Hostname

4. Now change the SELinux mode to permissive and restart the system to make Permanent changes for selinux.

$ sudo vim /etc/sysconfig/selinux
$ sudo init 6
Set SeLinux Mode
Set SeLinux Mode

Step 2: Installing Packages and changing Kernel Values

5. Once your system boots up properly, you can do a system upgrade and then install following required dependencies.

$ sudo yum clean metadata && sudo yum upgrade

$ sudo yum install binutils.x86_64 compat-libcap1.x86_64 compat-libstdc++-33.x86_64 compat-libstdc++-33.i686 \ 
compat-gcc-44 compat-gcc-44-c++ gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 glibc-devel.i686 glibc-devel.x86_64 \ 
ksh.x86_64 libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libaio.i686 \
libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 libXext.i686 libXext.x86_64 libXtst.i686 libXtst.x86_64 libX11.x86_64 \ 
libX11.i686 libXau.x86_64 libXau.i686 libxcb.i686 libxcb.x86_64 libXi.i686 libXi.x86_64 make.x86_64 unixODBC unixODBC-devel sysstat.x86_64

6. After installing all the above needed packages, now it’s time to do some changes at kernel level parameters in ‘/etc/sysct.conf file.

$ sudo vim /etc/sysctl.conf

Add or change the following values as suggested. Save and quit using wq!.

kernel.shmmax = 4294967295
kernel.shmall = 2097152
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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
Add Kernel Parameters
Add Kernel Parameters

7. Once you’ve added above values, now issue following command to take new changes into effect.

$ sudo sysctl -p
Load Kernel Parameters
Load Kernel Parameters

Note: The above values are half the size of physical memory in bytes. For example, have assigned 5GB memory for my virtual machine. So I’m using half of the memory for these settings.

8. Now it’s time to restart the machine and move further instructions on installing Oracle database.

$ sudo init 6

Step 3: Configuring System for Oracle Installation

9. Create the new groups Oracle inventory, OSDBA and OSOPER for Oracle installation.

$ sudo groupadd -g 54321 oracle
$ sudo groupadd -g 54322 dba
$ sudo groupadd -g 54323 oper
Create Oracle Groups
Create Oracle Groups

10. Create the new user oracle and add the user to already created groups.

$ sudo useradd -u 54321 -g oracle -G dba,oper oracle
$ sudo usermod -a -G wheel oracle
$ sudo passwd oracle
Create Oracle User
Create Oracle User

11. If your system is enabled with firewall, you need to disable or configure it according to your needs. To disable it, run the following commands.

$ sudo iptables -F
$ sudo service iptables save
$ sudo chkconfig iptables on
Disable CentOS Firewall
Disable Firewall

12. Create the following directory for installing Oracle and change the ownership and grand permission to the newly created directory using recursive.

$ sudo mkdir -p /u01/app/oracle/product/12.1.0/db_1
$ sudo chown -R oracle:oracle /u01
$ sudo chmod -R 775 /u01
$ ls -l /u01
Create Oracle Directory
Create Oracle Directory

13. Switch to root user to create environment for oracle user. You can skip this step, if you’re already using root login.

$ su - root

14. Next, we need to add the environmental variable for oracle user. Open and edit the profile file of oracle user and append the oracle environment entries. Here we don’t need to use sudo command, as we are already logged in as root user.

# vim /home/oracle/.bash_profile

Append the below Environment Entry. Save and exit the vi editor using wq!.

## Oracle Env Settings 

export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=oracle12c.tecmint.local
export ORACLE_UNQNAME=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=orcl

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

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Add Environment Variables
Add Environment Variables

Now exit from root user and login again as tecmint user and switch to oracle user. Again, this step is not required, if you are already using root account, just switch to oracle user for further instructions.

# exit  
# su - oracle

15. Here we need to check for the resource limits for oracle installing user. Here our Oracle installer user is oracle. So we must be logged in as oracle user, while doing resource check. Check for the soft and hard limits for file descriptor settings before installation.

$ ulimit -Sn
$ ulimit -Hn
$ ulimit -Su
$ ulimit -Hu
$ ulimit -Ss
$ ulimit -Hs
Check Resource Limits
Check Resource Limits

You may get different values in the above command. So, you need to manually assign the values for limits in configuration file as shown below.

$ sudo vim /etc/security/limits.conf

oracle	soft	nofile	1024	
oracle	hard	nofile	65536	
oracle	soft	nproc	2047
oracle	hard	nproc	16384
oracle	soft	stack	10240
oracle	hard	stack	32768
Assign Limits Values
Assign Limits Values

Next, edit the below file to set the limit for all users.

$ sudo vim /etc/security/limits.d/90-nproc.conf

By default it was set to

* soft nproc 1024

We need to change it to.

* - nproc 16384
Set User limits
Set User limits

Step 4: Downloading Oracle Packages

16. Then its time to pull down the oracle zip package from official site. To download Oracle package, you must be registered user or else sing-up and download the package using the below link.

  1. Oracle Database Software Downloads

I have already downloaded the zip package and extracted the contents of oracle installer.

$ cd ~
$ ls
$ unzip linuxamd64_12c_database_1of2.zip
$ unzip linuxamd64_12c_database_2of2.zip

That’s it for now, the article getting too lengthy and I can’t include all instructions in a one single page. So, in our next article we will show you step-by-step instructions on Oracle 12c installation and further configurations, till then stay tuned to Tecmint for latest updates.

Read Also: Installing Oracle 12c in RHEL/CentOS/Oracle Linux 6.5 – Part II

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Babin Lonston
I'm Working as a System Administrator for last 10 year's with 4 years experience with Linux Distributions, fall in love with text based operating systems.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

17 Comments

Leave a Reply
  1. Is there a link other than the oracle website that I can download the linuxamd64_12c_database_1of2.zip packages? I was unable to download on oracle after even registering on the website. Thanks

    Reply
    • Hi Bob,

      It’s the default UID and GID for oracle installation you can define your own, But if you keep the default and common for every installation in your environment it will be easier for migration, mount NFS etc..

      Reply
  2. Thank you, this is good article, very clear. just my opinion it would be nice if you mention to change hostname same as the machine hostname. ini this part : export ORACLE_HOSTNAME=oracle12c.tecmint.local. in my first attempt I just copy paste all the syntax, and my netca cannot be started after I follow instruction on chapter II. the error mention the host oracle12c.tecmint.local. once I change the hostname same as my hostname everything is good. now I can use oracle db as well. thank you so much

    Reply
  3. Hi,

    I am unable to edit the limits.conf file [Step: 3 =>15], i got “oracle is not in the sudoers file. This incident will be reported.” message.
    Note: I logged in root user.

    Kindly help me.

    Thanks in Advance,
    Senthilkumar

    Reply
  4. Thanks. I had to prepare a RH 6.5 server for an Oracle install. The DBA gave me a link to some Oracle documentation which was not helpful at all so I used this. No complaints so far. Thanks again.

    Reply
  5. Interesting article. Hope you have one for RAC on Linux as well. We are planning on installing a 4 node Linux (OL) cluster using 12c, and just wanted to compare all the different tricks to install.

    @Thanks

    Reply
  6. A lot of the prerequisites can be handled using the following package install

    sudo yum install -y oracle-rdbms-server-12cR1-preinstall

    Reply
  7. > Note: I’ve used ‘tecmint‘ user with sudo privileges
    > for this Oracle installation, but I strongly recommend
    > you to use root login for all below installation instructions.

    Thank you for this nice tutorial. One minor question: why do you “strongly recommend” against the use of sudo?

    Reply
  8. Hi

    Thanks for sharing this article. It is really very imp topic. Can you please sahre the performance tunning and post installation steps for Oracle database.

    Thanks again.

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.