Showing posts with label oracle 11g. Show all posts
Showing posts with label oracle 11g. Show all posts

Monday, September 18, 2017

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


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 $$$ )

Host-name: el6.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-6
http://dbaora.com/install-oracle-11g-on-oel6/

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

- OS Installation:
https://docs.oracle.com/cd/E37670_01/E41137/html/
https://oracle-base.com/articles/linux/oracle-linux-6-installation

- Network settings
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=1.0.5.5
NETMASK=255.255.255.0
GATEWAY=1.0.5.2
USERCTL=no

# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=el6.example.com
NETWORKING_IPV6=no
NOZEROCONF=yes

- 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    el6.example.com     el6

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

- Change kernel parameters 
# vi /etc/sysctl.conf
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2008805376
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   16384
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

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

- Create local yum repo from OL6 iso 
# mkdir /media/cdrom
# mount /dev/sr0 /media/cdrom
# vi /etc/yum.repo.d/dvd.repo
[dvd]
name=dvd-OL6.9x64
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0

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

Note: (ignore error about pdksh package or remove ksh and install pdksh from CentOS 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 
# service iptables stop
# chkconfig iptables off

- Create Oracle software installation directories 
# mkdir -p /u01/app/oracle/product/11.2.0/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=el6.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/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/db_1:Y

-Shutdown & Startup database (this file assume that you set oracle variables on .bash_profile file.)
- to start oracle database and oracle enterprise manager and listener
$ vi startdb.sh
#!/bin/bash
echo "Startup Oracle Database"
sqlplus / as sysdba << EOI
startup
EOI
echo "start LISTENER"
lsnrctl start
sleep 1m
echo "start Enterprise Manager"
emctl start dbconsole
echo "############### welcome back ##############"

$ chmod +x startdb.sh
$ ./startdb.sh # to startup Database & EM

- to shutdown oracle database and oracle enterprise manager and listener
$ vi stopdb.sh
#!/bin/bash
echo "Shutdown Enterprise Manager"
emctl stop dbconsole
echo "shutdown Oracle Database"
sqlplus / as sysdba << EOI
shutdown immediate
EOI
echo "stop LISTENER"
lsnrctl stop
echo "############### BYE BYE ##############"

$ chmod +x stopdb.sh
$ ./stopdb.sh # to shutdown Database & EM

- 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/6/x86_64//rlwrap-0.42-1.el6.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**



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**