Tuesday 18 November 2014

Oracle Installation On RHEL 5.x / 6.x

====================
Oracle 10g On RHEL 5.x
====================

#Unpack Files
Unzip cmd
Unzip the files: unzip 10201_database_linux32.zip

#Hosts File
# hostname
# hostname linux

 The /etc/hosts file must contain a fully qualified name for the server:
<IP-address>  <fully-qualified-machine-name>  <machine-name>
linux.com linux

#Set Oralce Kernel Parameters
 Add the following lines to the /etc/sysctl.conf file:

#shmax set of 50% of ram in byte when 1 GB of ram then 512*1024*1024
kernel.shmmax = 2147483648

#shmall is shmmax/PAGE_SIZE default pagesize is 4096 (4 KB)--- # getconf PAGE_SIZE
kernel.shmall = 2097152

#shmmni minimum size of shared segment is 4 KB (4096 in bytes)
kernel.shmmni = 4096

# Increase the size of shmall without reboot linux reboot system
# cat /etc/proc/sys/kernel/shmall
2097152

# echo 2097152> /etc/proc/sys/kernel/shmall

 Alternative command 
# sysctl -w kernel.shmall=2097152
# echo "kernel.shmall=2097152">> /etc/sysctl.conf

 Removing shared memory when show status 'dest' destroy then crash the shared memory segments.
# $ ipcs -m  //see the shmid column where status is dest then following next command
# $ ipcs -m -i 32768
# $ ipcrm shm 32768  //remove shmid


# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

# Run the following command to change the current kernel parameters:
/sbin/sysctl -p   (# sysctl -p)

# Add the following lines to the /etc/security/limits.conf file:
oracle           soft     nproc            2047
oracle           hard    nproc           16384
oracle           soft     nofile            1024
oracle           hard    nofile           65536

# Add the following line to the /etc/pam.d/login file, if it does not already exist:
session    required     pam_limits.so


# Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:

SELINUX=disabled
Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.




Setup
 Install the following packages:
 rpm -ivh binutils*
 rpm -ivh elfutils*
 rpm -ivh setarch-2*
 rpm -ivh make-3*
 rpm -ivh glibc-2.5-12.i386.rpm
 rpm -ivh glibc-2.5-12.i686.rpm
 rpm -ivh libaio-0*
 rpm -ivh compat-libstdc++-*
 rpm -ivh compat-libstdc++-33-3.2.3-61.i386.rpm
 rpm -ivh compat-libf2c*
 rpm -ivh glibc-headers-2.5-12.i386.rpm
 rpm -ivh glibc-devel-2.5-12.i386.rpm
 rpm -ivh compat-gcc-34-3.4.6-4.i386.rpm
 rpm -ivh compat-gcc-34-3*
 rpm -ivh compat-gcc-34-c++-3*
 rpm -ivh libgomp-4.1.1-52.el5.i386.rpm
 rpm -ivh gcc-4*
 rpm -ivh libXp-1*
 rpm -ivh openmotif-2*
 rpm -ivh compat-db-4*
 rpm -ivh glibc-common*
 rpm -ivh libstdc*
 rpm -ivh libgcc*
 rpm -ivh unixODBC*
 rpm -ivh sysstat*



# COMMAND
# cat /etc/passwd
# cat /etc/group
# userdel oracle
# groupdel oracle

# Create the new groups and users:
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle

# Create the directories in which the Oracle software will be installed:
mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /u01
chown -R oracle.oinstall /u02
chmod -R 775 /u01
chmod -R 775 /u02

# Login as root and issue the following command:
xhost +<machine-name>

# Edit the /etc/redhat-release file replacing the current release information
(Red Hat Enterprise Linux Server release 5 (Tikanga)) with the following:
vim /etc/redhat-release

redhat-4



# Login as the ORACLE user and ADD the following lines at the end of the .bash_profile file:

# su - oracle
$ vi .bash_profile


# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TSH1; 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

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi
:wq!

$. .bash_profile  //ROOT COMMANDS:

[root@beam oracle]# chown oracle:oinstall database/
# ls -lrt
# ls -li
# cd database
[root@beam database]# ls -lrt
[root@beam database]# chown -R oracle:oinstall *
[root@beam database]# ls -lrt
[root@beam database]# cd response
[root@beam response]# ls -lrt


# Installation
LOGIN oracle user LOGOUT root user



Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=<machine-name>:0.0; export DISPLAY

 Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory:
./runInstaller

 During the installation enter the appropriate ORACLE_HOME and name then continue installation. For a more detailed look at the installation process, click on the links below to see screen shots of each stage.

[root@beam oraInventory]# ./orainstRoot.sh

Run the following scripts as root:
   /u01/app/oracle/oraInventory/orainstRoot.sh
   /u01/app/oracle/product/10.2.0/db_1/root.sh




================
11g On RHEL 5.x
================
umount tmpfs
mount -t tmpfs shmfs -o size=2000m /dev/shm

/etc/fstab
shmfs /dev/shm tmpfs size=2000m 0 0

physical recomment 1024Mb > 1100
swap double


 The /etc/hosts file must contain a fully qualified name for the server:
<IP-address>  <fully-qualified-machine-name>  <machine-name>
linux.com linux

#Set Oralce Kernel Parameters
 Add the following lines to the /etc/sysctl.conf file:
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576

# Run the following command to change the current kernel parameters:
/sbin/sysctl -p   (# sysctl -p)

# Add the following lines to the /etc/security/limits.conf file:
oracle           soft     nproc         2047
oracle           hard    nproc         16384
oracle           soft     nofile          1024
oracle           hard    nofile          65536
oracle           soft     stack          10240

# Add the following line to the /etc/pam.d/login file, if it does not already exist:
session    required     pam_limits.so


# Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:

SELINUX=disabled
Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.




Setup
 Install the following packages:
 rpm -ivh binutils*
 rpm -ivh elfutils*
 rpm -ivh setarch-2*
 rpm -ivh make-3*
 rpm -ivh glibc-*
 rpm -ivh libaio-0*
 rpm -ivh compat-libstdc++-*
 rpm -ivh compat-libstdc++-33*
 rpm -ivh compat-libf2c*
 rpm -ivh glibc-headers-*
 rpm -ivh glibc-devel-*
 rpm -ivh compat-gcc-*
 rpm -ivh compat-gcc-34-3*
 rpm -ivh compat-gcc-34-c++-3*
 rpm -ivh libgomp-*
 rpm -ivh gcc-4*
 rpm -ivh libXp-1*
 rpm -ivh openmotif-2*
 rpm -ivh compat-db-4*
 rpm -ivh glibc-common*
 rpm -ivh libstdc*
 rpm -ivh libgcc*
 rpm -ivh unixODBC*
 rpm -ivh sysstat*



# COMMAND
# cat /etc/passwd
# cat /etc/group
# userdel oracle
# groupdel oracle

# Create the new groups and users:
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle

# Create the directories in which the Oracle software will be installed:
mkdir -p /u01/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /u01
chown -R oracle.oinstall /u02
chmod -R 775 /u01
chmod -R 775 /u02

# Login as root and issue the following command:
xhost +<machine-name>

# Edit the /etc/redhat-release file replacing the current release information
(Red Hat Enterprise Linux Server release 5 (Tikanga)) with the following:
vim /etc/redhat-release

redhat-4



# Login as the ORACLE user and ADD the following lines at the end of the .bash_profile file:

# su - oracle
$ vi .bash_profile


# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TSH1; 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

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi
:wq!

$. .bash_profile  //ROOT COMMANDS:

[root@beam oracle]# chown oracle:oinstall database/
# ls -lrt
# ls -li
# cd database
[root@beam database]# ls -lrt
[root@beam database]# chown -R oracle:oinstall *
[root@beam database]# ls -lrt
[root@beam database]# cd response
[root@beam response]# ls -lrt


# Installation
LOGIN oracle user LOGOUT root user


Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=<machine-name>:0.0; export DISPLAY

 Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory:
./runInstaller




===================
Oracle  11g On RHEL 6
===================

linux 6.1 on Oracle

---tmp approx 5 gb

#Unpack Files
Unzip cmd
Unzip the files: unzip 10201_database_linux32.zip

#Hosts File
# hostname
# hostname linux

 The /etc/hosts file must contain a fully qualified name for the server:
<IP-address>  <fully-qualified-machine-name>  <machine-name>
linux.com linux

#Set Oralce Kernel Parameters
 Add the following lines to the /etc/sysctl.conf file:

kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
fs.aio-max-nr = 1048576
fs.suid_dumpable= 1
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

# Run the following command to change the current kernel parameters:
/sbin/sysctl -p   (# sysctl -p)

# Add the following lines to the /etc/security/limits.conf file:
oracle           soft     nproc            2047
oracle           hard    nproc           16384
oracle           soft     nofile          4096
oracle           hard    nofile           65536
oracle soft stack 10240


# Add the following lines to the /etc/security/limits.d/90- file:



# Add the following line to the /etc/pam.d/login file, if it does not already exist:
session    required     pam_limits.so


# Disable secure linux by editing the /etc/selinux/config file, making sure the SELINUX flag is set as follows:

SELINUX=permissive
Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.






-----Setup
 Install the following packages:



rpm -ivh libstdc++-devel-4.4.5*
rpm -ivh kernel-header-2.6.32-131*
rpm -ivh glibc-headers-2.12*
rpm -ivh glibc-devel-2.12*

rpm -ivh gnome-icon-theme-2*
rpm -ivh dmz-cursor-themes-0.4.4*
rpm -ivh sgml-common-0.6*
rpm -ivh libaio-devel-0.3.107*
rpm -ivh ncurses-devel-5.7-3*
rpm -ivh elfutils-libelf-devel-0.152*

rpm -ivh compat-gcc-34-3*
rpm -ivh libXxf86misc-1.0.2*
rpm -ivh libXmu-1.0.5*
rpm -ivh mpfr-2.4*
rpm -ivh cpp-4.4.5*

rpm -ivh xorg-x11-xauth-1.0*
rpm -ivh compat-gcc-34*
rpm -ivh libdaemon-0.14-1*
rpm -ivh avahi-0.6.25*


rpm -ivh avahi-glib-0.6.25*
rpm -ivh shared-mime-info-0.70*
rpm -ivh liblDL-0.8*
rpm -ivh ORBit2-2.14*

rpm -ivh GConf2-2.28*
rpm -ivh gnome-vfs2-2*
rpm -ivh libbonobo-ltdl-2.24*
rpm -ivh libtool-ltddl-2.2*

rpm -ivh unixODBC-2.2.14*
rpm -ivh gtk2-engines-2.18.4*
rpm -ivh libmcpp-2.7*
rpm -ivh mcpp-2.7.2*
rpm -ivh xorg-x11-server-utils-7.4*
rpm -ivh ConsoleKit-x11-xinit-1.0*
rpm -ivh libXp-1.0.0*
rpm -ivh libXxf86dga-1.1.1-1*
rpm -ivh libdmx-1.1.0*
rpm -ivh xorg-x11-utils-7.4-8*
rpm -ivh compat-db43-4.3.29*
rpm -ivh compat-db42-4.2.52*
rpm -ivh ppl-0.10.2-11*
rpm -ivh cloog-ppl-0.15.7*
rpm -ivh gcc-4.4.5-6*
rpm -ivh gcc-c++-4.4.5-6*
rpm -ivh compat-libstdc++-33-3*
rpm -ivh compat-db-4.6.21*
rpm -ivh gnome-themes-2.28.1-6*
rpm -ivh system-icon-themes-6*
rpm -ivh system-gnome-themes-6*
rpm -ivh unixODBC-devel-2.2*
rpm -ivh readline-devel-6.0*
rpm -ivh libgnome-2.28.0*




# COMMAND
# cat /etc/passwd
# cat /etc/group
# userdel oracle
# groupdel oracle

# Create the new groups and users:
groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle

# Create the directories in which the Oracle software will be installed:
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle.oinstall /u01
chown -R oracle.oinstall /u02
chmod -R 775 /u01
chmod -R 775 /u02

# Login as root and issue the following command:
xhost +<machine-name>


# Edit the /etc/redhat-release file replacing the current release information
(Red Hat Enterprise Linux Server release 6 (Tikanga)) with the following:
vim /etc/redhat-release

redhat-4







# Login as the ORACLE user and ADD the following lines at the end of the .bash_profile file:
# su - oracle
$ vi .bash_profile

# Oracle Settings
#TMP=/tmp; export TMP
#TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TSH1; 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

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi
:wq!

$. .bash_profile  //ROOT COMMANDS:



# Installation
LOGIN oracle user LOGOUT root user



Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:
DISPLAY=<machine-name>:0.0; export DISPLAY

 Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory:
./runInstaller

 During the installation enter the appropriate ORACLE_HOME and name then continue installation. For a more detailed look at the installation process, click on the links below to see screen shots of each stage.


[root@beam oraInventory]# ./orainstRoot.sh



Run the following scripts as root:
   /u01/app/oracle/oraInventory/orainstRoot.sh
   /u01/app/oracle/product/10.2.0/db_1/root.sh





--------------------------------------------------------------------------------------------------------------------------

What is oraInventory

The Orainventory is the location for the OUI's Book keeping
The inventory stores information about.
  • All the Oracle software products installed on all ORACLE_HOMES on a machine
  • Other non-oracle products such as Java Runtime env's (JRE)

  1. Global Inventory
Global Inventory holds information about Oracle Products on a Machine, The inventory contains the high level list of all oracle products installed on a machine such as ORACLE_HOMES or JRE.
It doesn't have any information about the details of patches applied on each ORACLE_HOMES.
There should be only one per machine. Its locations is defined in the oraInst.loc in /etc (on Linux) or /var/opt/oracle (solaris).
  1. Local Inventory
There is one Local inventory per ORACLE_HOME.
Inventory inside each Oracle Home is called as local Inventory or ORACLE_HOME Inventory. This Inventory holds information to that ORACLE_HOME only.

Can I have multiple Global Inventories on a machine?
Can you have multiple global Inventory and answer is YES you can have multiple global Inventory but if your upgrading or applying patch then change Inventory Pointer oraInst.loc to respective location.
If you are following single global Inventory and if you wish to uninstall any software then remove it from Global Inventory as well.

What to do if my Global Inventory is corrupted?
Follow Link else below : RE-CREATE ORAINVENTORY
If your global Inventory is corrupted, you can recreate global Inventory on machine using Universal Installer and attach already Installed oracle home by option
-attachHome
./runInstaller -silent -attachHome -invPtrLoc $location_to_oraInst.loc ORACLE_HOME=Oracle_Home_Location ORACLE_HOME_NAME=Oracle_Home_Name CLUSTER_NODES={}

Do I need to worry about oraInventory during oracle Apps 11i cloning ?
No, Rapid Clone will update both Global & Local Inventory with required information, you don't have to worry about Inventory during Oracle Apps 11i cloning.

How to Move oraInventory from one location to other?Find the current location of the central inventory (Normally $ORACLE_BASE/oraInventory):
Open the oraInst.loc file in /etc and check the value of inventory_loc
cat /etc/oraInst.loc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall 

Remark: The oraInst.loc file is simply a pointer to the location of the central inventory (oraInventory)
Copy the oraInventory directory to the destination directory
cp -Rp /u01/app/oracle/oraInventory /u02/app/oracle/oraInventory
Edit the oraInst.loc file to point to the new location
vi /etc/oraInst.loc
inventory_loc=/u02/app/oracle/oraInventory
inst_group=dba




How To Install oracle in silent mode

No comments: