Wednesday, April 27, 2016

Installing Oracle 12c Database Software on Linux 7

This document explains how to install Oracle 12c Database software on Oracle Linux 6. At the time of writing this document, latest 12c version is 12.1.0.2 which can be downloaded from My Oracle Support using patch search for patch 17694377 (Disk 1 and Disk 2 are needed for Oracle Database software). Otherwise you can also download 12.1.0.1 from www.oracle.com. For this article, I have extracted the downloaded software under /u02/softwares directory.
You may also find following related documents interesting.
InstallingOracle 12c Database on Linux 6

1)
Make sure you have entries in the /etc/host file for the name resolution.
127.0.0.1   localhost localhost.localdomain localhost
192.231.231.40 salman1.salman.com salman1

2)
Edit /etc/selinux/config and set value for SELINUX to either “permissive” or “disabled”
SELINUX=permissive
3)
As root user, configure Shared Memory File System. Add following line in /etc/fstab file for shared memory file system. Modify the value of “size” based on the amount of memory you will be using for your SGA
tmpfs                                   /dev/shm                tmpfs   rw,exec,size=8g        0 0
4)
Disable the firewall

[root@salman1 ~]# systemctl start firewalld.service
[root@salman1 ~]# systemctl stop firewalld.service
[root@salman1 ~]# systemctl disable firewalld.service
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'

5)
Reboot the host

6)
We can perform automatic configuration of the host using “yum” command. If you want to do manual configuration, skip this step and go to next step (Step 7).
Automatic configuration would perform following tasks
- Installation of required RPM packages
- Setup kernel parameters in /etc/sysctl.conf file
- Creation of OS groups (oinstall, dba) and OS user (oracle)
- Setting limits for installation user “oracle”

For Oracle Linux, follow the steps mentioned in the following documents to access the online yum repository.
http://public-yum.oracle.com/

Execute following command to perform all prerequisites automatically..

[root@salman1 ~]# yum install oracle-rdbms-server-12cR1-preinstall –y

As already mentioned, above command will install all required packages which are needed for grid infrastructure and/or RDBMS software installation. If you also plan to install a 32-bit client on this x86_64 server, you would also need to install 32-bit version of these RPM packages manually.
[root@salman1 ~]# yum install glibc-2.17-36.el7.i686
[root@salman1 ~]# yum install glibc-devel-2.17-36.el7.i686
[root@salman1 ~]# yum install libaio-0.3.109-9.el7.i686
[root@salman1 ~]# yum install libaio-devel-0.3.109-9.el7.i686
[root@salman1 ~]# yum install libXi-1.7.2-1.el7.i686
[root@salman1 ~]# yum install libXtst-1.2.2-1.el7.i686
[root@salman1 ~]# yum install libgcc-4.8.2-3.el7.i686
[root@salman1 ~]# yum install libstdc++-4.8.2-3.el7.i686
[root@salman1 ~]# yum install libstdc++-devel-4.8.2-3.el7.i686
If you want to install form Oracle Linux installation media, use “rpm -i” command to install the packages.
Automatic configuration also sets the required kernel parameters in /etc/sysctl.conf file and also sets OS limits for user oracle.
Automatic configuration would create default OS groups i.e. oinstall and dba (with group ID 54321 and 54322 respectively), and OS user (oracle) with user ID 54321. Reset the password of oracle user
Set passwords for oracle user
[root@salman1 ~]# passwd oracle

If you have performed this step; skip next 4 steps (7, 8, 9 and 10)

7)
Install following RPM packages (or latest version) from either yum repository or from Linux 7 media
binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
gcc-4.8.2-3.el7.x86_64
gcc-c++-4.8.2-3.el7.x86_64
glibc-2.17-36.el7.i686
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.i686
glibc-devel-2.17-36.el7.x86_64
libaio-0.3.109-9.el7.i686
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.i686
libaio-devel-0.3.109-9.el7.x86_64
ksh
make-3.82-19.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.i686
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.i686
libstdc++-devel-4.8.2-3.el7.x86_64
sysstat-10.1.5-1.el7.x86_64
unixODBC-2.3.1

Example (yum)
[root@salman1 ~]# yum install glibc

Example (Linux Media)
[root@salman1 ~]# rpm -i glibc

Example (Check after install)
[root@salman1 ~]# rpm -q glibc
glibc-2.17-55.el7.x86_64

8)
Edit /etc/sysctl.conf add following entries to set kernel parameters
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Execute following command after adding above lines
/sbin/sysctl -p


9)
As user root, add OS groups and users.
Add groups
[root@salman1 ~]# groupadd -g 54321 oinstall
[root@salman1 ~]# groupadd -g 54322 dba
[root@salman1 ~]# groupadd -g 54323 oper

Add users
[root@salman1 ~]# useradd -u 54321 -g oinstall -G dba,oper oracle

Set passwords for oracle user
[root@salman1 ~]# passwd oracle

10)

Create a .conf file (file name can be anything) under /etc/security/limits.d directory to set shell limits for oracle user. For example, create file oracleusers.conf with following entries. Alternatively, you can also set the limits in /detc/security/limits.conf. But I would prefer to set under /etc/security/limits.d directory.
# Oracle user
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728

11)
Log in as oracle user and add environmen variables in .bash_profile file.
ORACLE_SID=db12c; export ORACLE_SID
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/12.1.0/db; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib; export CLASSPATH
export TEMP=/tmp
export TMPDIR=/tmp


12)
Log in as oracle user using Linux desktop, or you may also use any X server software.

13)
Initiate installation by executing ./runInstaller from the directory where software was unzipped.
$ cd /u02/softwares/database
$ ./runInstaller
Click Next

14)
Click Next 
 

15)
I selected “Install database software only”. You may also select “Create and Configure a database” if you want to create a database during the installation process. Otherwise you can create an Oracle database using DBCA, after the installation.
Click Next

16)
Since this is a non-RAC installation, select “Single instance database installation”, and click Next

17)
Click Next

18)
Click Next (or select appropriate edition you want to install)

19)
Change directories according to your requirement and click Next



20)Click Next. After following screen, next step is “Prerequisite Checks”, resolve any issues if prerequisite checks list any problem by stopping at prerequisite checks screen.


21)
Click Install

22)
Monitor Progress

23)
Execute “root.sh” as root user when prompted. If this is first ever oracle software installation on this server then you would see a prompt that lists 2 scripts to be executed as root, orainstRoot.sh and root.sh. Execute script(s) as root and click OK.

24)
Installation is successful. Click Close


Search Oracle Community Forums