首页 > 代码库 > Install Oracle 11G Release 2 (11.2) on Centos Linux 7

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

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.

  • Oracle support
  • OTN: Oracle Database 11G Release 2 Software (64-bit).
  • edelivery: Oracle Database 11G Release 2 Software (64-bit)

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 = 4398046511104kernel.shmall = 1073741824kernel.sem = 250 32000 100 128fs.aio-max-nr = 1048576fs.file-max = 6815744net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.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    131072oracle   hard   nproc    131072oracle   soft   nofile   131072oracle   hard   nofile   131072oracle   soft   core     unlimitedoracle   hard   core     unlimitedoracle   soft   memlock  50000000oracle   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 centos7PING 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 0msrtt min/avg/max/mdev = 0.040/0.040/0.040/0.000 ms

Modify .bash_profile for user oracle in his home directory

# Oracle Settingsexport TMP=/tmpexport ORACLE_HOSTNAME=centos7.dbaora.comexport ORACLE_UNQNAME=ORA11Gexport ORACLE_BASE=/ora01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export ORACLE_SID=ORA11GPATH=/usr/sbin:$PATH:$ORACLE_HOME/binexport 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 installedgcc-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 installedlibaio-0.3.109-12.el7(x86_64)package libaio-devel is not installedlibgcc-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 installedpackage 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.rpmrpm -Uvh libaio-devel*.x86_64.rpmrpm -Uvh unixODBC*.x86_64.rpmrpm -Uvh ksh*.x86_64.rpm
  • Second option – use yum install command
yum -y install elfutils-libelf-develyum -y install libaio-develyum -y install unixODBCyum -y install unixODBC-develyum -y install ksh

Create directory structure

mkdir -p /ora01/appchown oracle:oinstall /ora01/appchmod 775 /ora01/app

create ORACLE_BASE directory for oracle

mkdir -p /ora01/app/oraclechown oracle:oinstall /ora01/app/oraclechmod 775 /ora01/app/oracle

Create ORACLE_HOME directory for oracle

mkdir -p /ora01/app/oracle/product/11.2.0/db_1chown 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.4unzip p13390677_112040_Linux-x86-64_1of7.zipunzip 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 tnsalias 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 settingsenvoORACLE_UNQNAME=ORA11GORACLE_SID=ORA11GORACLE_BASE=/ora01/app/oracleORACLE_HOSTNAME=centos7.dbaora.comORACLE_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

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