Saturday, September 16, 2017

Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 7

Note: preferred OS with database compatibility
RHEL/OL 6 -> Oracle Database 11g
RHEL/OL7 -> Oracle Database 12c   

Note: ignore oracle installer errors  for new versions of packages not recognized even they are installed. (no packages errors in 11.2.0.3.0 and 11.2.0.4.0 patch from oracle support $$$ )

Note: During the link phase you will encounter an error invoking the "ins_emagent.mk" file. To fix this, edit the "$ORACLE_HOME/sysman/lib/ins_emagent.mk", doing a search and replace for the line shown below.

FROM:
$(MK_EMAGENT_NMECTL)
TO  :
$(MK_EMAGENT_NMECTL) -lnnz11
Click the "Retry" button.

Note: if you get error about Enterprise manager during installation just continue and after finish installation rebuild repo

$ emca -config dbcontrol db -repos recreate

Host-name: el7.example.com
IP-address: 1.0.5.5

sources:
https://docs.oracle.com/cd/E11882_01/install.112/e24326/
https://oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-7
http://dbaora.com/install-oracle-11gr2-on-oracle-linux-7-oel7/

- Software Download:
https://edelivery.oracle.com

- OS Installation:
https://docs.oracle.com/cd/E52668_01/E54695/html/
http://dbaora.com/install-oracle-linux-7/
https://oracle-base.com/articles/linux/oracle-linux-7-installation


- SSH Login
$ ssh -X root@1.0.5.5 # (-X to enable remote graphics)
$ touch  ~/.Xauthority #(if not existed)

- Edit /etc/hosts file 
# vi /etc/hosts
1.0.5.5    el7.example.com     el7

and edit /etc/hostname file:
# vi /etc/hostname
el7.example.com

- Change kernel parameters 
# vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1987579904
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
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=1048586

applying kernel new parameters 
# /sbin/sysctl -p

- Change OS resources limits 
# vi /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

and this file too.
# vi /etc/pam.d/login
session    required     pam_limits.so

Amend the "/etc/security/limits.d/90-nproc.conf" file as described below
# vi /etc/security/limits.d/90-nproc.conf

Change this
*          soft    nproc    1024

To this
* - nproc 16384
 

- Install required packages for both 64bit & 32bit architect
# yum install -y binutils elfutils-libelf-devel compat-libcap1 compat-libstdc++-33.i686 compat-libstdc++-33 gcc gcc-c++ glibc.i686 glibc glibc-devel.i686 glibc-devel ksh libaio.i686 libaio libaio-devel.i686 libaio-devel libgcc.i686 libgcc libstdc++.i686 libstdc++ libstdc++-devel.i686 libstdc++-devel libXi.i686 libXi libXtst.i686 libXtst make sysstat unixODBC unixODBC-devel unixODBC.i686 unixODBC-devel.i686

Note: (ignore error about pdksh package or remove ksh and install pdksh from RHEL 5 x86_64 packages pkgs.org)

- Create new groups & users
# groupadd -g 54321 oinstall
# groupadd -g 54322 dba
# groupadd -g 54323 oper
# groupadd -g 54324 backupdba
# groupadd -g 54325 dgdba
# groupadd -g 54326 kmdba
# groupadd -g 54327 asmdba
# groupadd -g 54328 asmoper
# groupadd -g 54329 asmadmin

# useradd -g oinstall -G dba,oper oracle
# passwd oracle

- Edit SELinux settings for installation
# vi /etc/selinux/config
SELINUX=permissive
# setenforce permissive
# getenforce 
Permissive

- Disable firewalld 
# systemctl stop firewalld
# systemctl disable firewalld

- Create Oracle software installation directories 
# mkdir -p /u01/app/oracle/product/11.2.0.1/db_1
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01

- Edit oracle user profile file 
# vi /home/oracle/.bash_profile
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=el7.example.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.1/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
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/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

- Unpack files into Virtualbox guest and start installer 
if you make shared folder named oracle in your host machine with software source files and guest additions in installed guest machine
# usermod -aG vboxsf oracle # add oracle user to vboxsf to list shared folders
# su - oracle
$ cd /media/sf_oracle/
$ unzip linux.x64_11gR2_database_1of2.zip -d /tmp
$ unzip linux.x64_11gR2_database_2of2.zip -d /tmp
$ /tmp/database/runInstaller &

- Post Installation
Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.
# vi /etc/oratab
DB11G:/u01/app/oracle/product/11.2.0.1/db_1:Y

- SQL PLUS format 
# rpm -Uvh http://linuxdownload.adobe.com/linux/x86_64//flash-player-npapi-27.0.0.130-release.x86_64.rpm
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/r/rlwrap-0.42-1.el7.x86_64.rpm
$ echo "alias sqlplus='rlwrap sqlplus' " >> /home/oracle/.bash_profile

$ vi $ORACLE_HOME/sqlplus/admin/glogin.sql
SET SERVEROUTPUT ON
SET HEADING ON
SET ECHO ON
SET PAGESIZE 50000
SET PAGES 0
SET LINESIZE 80
DEFINE _EDITOR = gedit
SET COLSEP "|"
SET CONCAT "."
SET CONCAT "!"
SET NEWPAGE NONE
SET TAB OFF
SET NULL **NULL**


No comments:

Post a Comment