Installing Oracle 11g R2 on Enterprise Linux 5
Note: for any installation, you should check the Release Notes documenation before taking any practical step.
Installation Environment
Emulation software: VMWare Workstation 7 for Windows
OS: Red Hat Enterprise Linux 5.2 for x86
Required Software
Oracle Database 11g Release 2 for Linux x86 32-bit
Used Hardware
In the VMWare: create one virtual machine with the following specs:
o 2.0 GB RAM
o One ethernet cards: can be configured as bridged or host-only in VMware.
o One local hardisk with 32 GB on SCSI 0:0. It will be used for software installation.
o One local hardisk with 20 GB on SCSI 1:0. It will be used for Oracle Database data
files.
o One local hardisk with 20 GB on SCSI 1:1. It will be used for Oracle Database flash
recovery.
o CPU Count: 2 (optional)
Installation Plan
1. Preinstallation tasks:
o Hardware requirements
o Software requirements
o Environment configuration
2. Oracle Database 11g Software Installation
3. Apply Patchset
4. Configure Listeners
5. Create Database
6. Postinstallation tasks
1. Preinstallation tasks
Install Oracle Enterprise Linux in the first local hardisk. Install nothing in the remaining
disks.
Note: for a production system, consider becoming an Oracle Unbreakable Linux customer
and register your server on the Unbreakable Linux Network.
o Give the ethernet card IP 192.168.4.100 and the hostname srv100.mydomain.com.
Define a gateway. If it does not exist, make it same as the host IP address.
o Insall the following packages:
Desktop Environments
o GNOME Desktop Environment
Applications
o Graphical Internet (optional)
o Editors (optional)
Development
o Development Libraries
o Development Tools
Servers
o Do not select anything in this group.
Base System
o Administration Tools
o System Tools
Add the package 'sysstat' by clicking on the Details link
and selecting "sysstat - The sar an iostat system
monitoring commands." from the Optional Packages list.
X Window System
Complete the installation
RHEL 5 Bug: After the Installation compelets, RHEL 5.2 and below will hang on booting
when it reaches to "starting udev" line. To solve this problem, shutdown the Vmware
machine and change the CPU count and Core Count to only one. Implement the changes
below, then shutdown the machine, set CPU count back to 2 and startup the machine.
put the kernel command line parameters at the end of the "kernel" line:
vi /boot/grub/grub.conf
add divider=10 clocksource=acpi_pm
For example: kernel /vmlinuz-2.6.18 .. clock=acpi_pm divider=10
For Vmware machines, install VMWare tools.
Install further packages:
# to know distribution and version of Linux (Red Hat Ent. 5.2 used)
cat /etc/issue
# to know kernel version (and its errata level) (2.6.18-92 or newer)
uname -r
# to list missed packages:
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils \
compat-libstdc++-33 \
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
# for missed packages, install them:
rpm -Uvh libaio-devel-0.3.106-3.2.i386.rpm
rpm -Uvh unixODBC*
# SELINUX must be disabled
cat /etc/selinux/config | grep SELINUX=
vi /etc/selinux/config
SELINUX=disabled
shutdown -h now -r
Check the hardware requirements
# Hardware Requirements (in cluster nodes)
# At least 1.0 GB of physical memory
grep MemTotal /proc/meminfo
# swap space: same as the amount of physical memory
grep SwapTotal /proc/meminfo
# to display swap and memory in one command:
free
# if you don't have enought swap,
# you can add swap space by creating a temporary swap file.
# let's say about 500MB:
dd if=/dev/zero of=tempswap bs=1k count=500000
chmod 600 tempswap
mke2fs tempswap
mkswap tempswap
swapon tempswap
# 1 GB disk space in /tmp
df -h /tmp
# 4 GB of disk space for Oracle software
df
The size of the shared memory should be at least the greater of
MEMORY_MAX_TARGET and MEMORY_TARGET for each Oracle instance on the computer.
To determine the amount of shared memory available, enter the following
command:
df -h /dev/shm/
# to adjust the shared memory file system size:
umount tmpfs
mount -t tmpfs shmfs -o size=1200m /dev/shm
Create the required network configuration:
ping srv100
ping srv100.mydomain.com
# Network names Resolution
# configure /etc/hosts if no domain server is used
cat /etc/hosts
127.0.0.1 srv100.mydomain.com srv100 localhost.localdomain
localhost
Create and configure the required OS users and groups
# all group and user ids on all the nodes must have identical id
# Grid Infrastructure (GI) and the Oracle RDBMS home will
# be installed using different users:
# oracle inventory group
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/useradd -u 502 -g oinstall -G dba oracle
# set passwords
passwd oracle
# make sure nobody user exists (if not there, create it useradd nobody)
id nobody
# define the env variables for oracle user
vi /home/oracle/.bash_profile
# Oracle evn vars
export EDITOR=vi
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=srv100.mydomain.com
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=ora11gr2
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
# shell startup file
vi /etc/profile
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
# for C shell
vi /etc/csh.login
if ( $USER = "oracle" || $USER = "grid" ) then
limit maxproc 16384
limit descriptors 65536
endif
Configure kernel parameters and shell limits
Note: If you make a mistake with a parameter setting and your system does not start, then
you must start Linux in the single-user runlevel (runlevel 1). At this runlevel, the
/etc/sysctl.conf file is not run.
# Configuring kernel parameters and shell limits
# they can be tuned for a production db
# Append the following to the /etc/sysctl.conf file as the root user:
vi /etc/sysctl.conf
# kernel.shmmax not stated in 11g R2 (max: 4GB) (169706.1)
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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 = 1048576
# to take immediate effect
/sbin/sysctl -p
# User Shell Limits
# memlock is used to increase the per-process max locked memory
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/pam.d/login
session required pam_limits.so
Create the required directories for the Oracle database software:
# to know if there is an existing oracle inventory
# from its output, ORACLE_BASE will be parent of oraInventory
more /etc/oraInst.loc
# to identify existing Oracle home directories
more /etc/oratab
# Oracle Inventory Directory
# as a root
mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory
# Oracle Base Directory
mkdir -p /u01/app/oracle
#needed to ensure that dbca is able to run after the rdbms installation
mkdir -p /u01/app/oracle/cfgtoollogs
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
# Oracle RDBMS Home Directory
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1
chmod -R 775 /u01/app/oracle/product/11.2.0/db_1
# staging area to hold software installation
mkdir -p /u01/stage11g/db
chown -R oracle:oinstall /u01/stage11g/db
chmod -R 775 /u01/stage11g/db
Partition and mount the disks:
#define the disks to partition
fdisk -l | grep '^Disk'
# as a root, for the disks /dev/sdb and /dev/sdc
#partition the disks:
fdisk /dev/sdb
# answers: "n", "p", "1", "Return", "Return", "p" and "w"
Note: if the following message appears after the "w" command:
WARNING: Re-reading the partition table failed with error 16: Device or
resource busy, then you can avoid restarting the machine by the following
command: partprobe
# to make sure partions are created
ls -lX /dev/sd*
# format the paritions
mkfs.ext3 /dev/sdb1
mkfs.ext3 /dev/sdc1
# Mount the new disk
mkdir /u02
mount /dev/sdb1 /u02
mkdir /u03
mount /dev/sdc1 /u03
df -H
# Update /etc/fstab
vi /etc/fstab
/dev/sdb1 /u02 ext3 defaults 1 2
/dev/sdc1 /u03 ext3 defaults 1 2
# create folder for the db data
mkdir -p /u02/oradata/
chown -R oracle:oinstall /u02/oradata/
chmod -R 775 /u02/oradata/
# create folder for the flash area
mkdir -p /u03/oraflash/
chown -R oracle:oinstall /u03/oraflash/
chmod -R 775 /u03/oraflash/
As oracle, copy software installation into /u01/stage11g/db
2. Oracle Database 11g Software Installation
-- start OUI
su - oracle
cd /u01/stage11g/db
./runInstaller
Follow the steps.
Install database software only.
3. Apply Patchset
4. Configure Listeners
cd /u01/app/oracle/product/10.2.0/db_1/bin
./netca &
Add a new listener
Add Naming mtehods: Local Naming, EZConnect
5. Create Database
cd /u01/app/oracle/product/10.2.0/db_1/bin
./dbca &
follow the steps to create a database with sid: ora11gr2
The DBCA may pop up the following message in the end of db creation:
"Error securing Database control, Database Control has been brought up in nonsecure
mode. To secure the Database Control execute the following commands:
... "
6. Postinstallation Tasks
Verify OEM:
# verify that OEM is working
https://srv100.mydomain.com:1158/em
# restart the dbconsole if required
emctl status dbconsole
emctl stop dbconsole
emctl start dbconsole
# check Oracle processes:
ps -eo pid -o command | grep ora_ | grep -v grep
Consider implementing automatic database startup. See: Automatically Starting Databases
Consider implementing automatic EM Database Control startup. See: Implementing EM
Database Control Auto Startup
Consider using rlwrap utility with SQL*Plus and RMAN:
o Using rlwrap Utility with RMAN in Unix-Based Systems
o Using rlwrap Utility with SQL*Plus in Unix-Based Systems
For easy Oracle Home access:
echo "alias db='cd $ORACLE_HOME'" >> /home/oracle/.bashrc
0 comments:
Please Post your comment ...