Saturday, August 21, 2010

INSTALLATION OF ORACLE DATABASE IN LINUX

Being my first post i will start with the installation of Oracle 10G RDBMS in Linux

Oracle Database works very well under in *inx environment than windows .Oracle software can be installed in several ways in this post i am going talk about interactive installation(GUI MODE)

STEPS FOR INSTALLATION:

Prerequsites:
MINIMUM HARDWARE REQUIREMENTS
• 1024 MB of physical random access memory (RAM).
• 2 GB of swap space (or twice the size of RAM).
• Swap space between one and two times the size of RAM (on systems with 2 GB or more of RAM).
• 400 MB of disk space in the /tmp directory .
• 2.1 GB of disk space for the Oracle software and Sample Schema Database.
Being an interactive installation (GUI) an X-Terminal window is required .

Checking The requirements:
login into server as ROOT
su - root
Password
Checking the amount of RAM:
# grep MemTotal /proc/meminfo

Checking the Swap space:
# grep SwapTotal /proc/meminfo

Checking for Temp Space:
# df -k /tmp

Checking the Total Disk Space:
# df -k

Checking the CPU architecture:
# grep "model name" /proc/cpuinfo
MINIMUM SOFTWARE REQUIREMENTS
Operating system One of the following operating system versions:

■ Red Hat Enterprise Linux AS/ES 3.0 (Update 4 or later)
■ Red Hat Linux 4.0
■ SUSE Linux Enterprise Server 9.0 with SP 2 or later
■ Asianux 1.0
■ Asianux 2.0
Linux Kernal Requirements:

Red Hat Enterprise Linux 3.0 and Asianux 1.0:
2.4.21-27.EL
Note: This is the default kernel version.

Red Hat Enterprise Linux 4.0 and Asianux 2.0:
2.6.9-5.EL

SUSE Linux Enterprise Server 9.0:
2.6.5-7.201

To check the Kernal version:
# uname -r

Packages Needed:
For installation of Oracle some Linux libraries are required .The packages are

Red Hat Enterprise Linux 3.0 and Asianux 1.0:
make-3.79.1
gcc-3.2.3-34
glibc-2.3.2-95.20
compat-db-4.0.14-5
compat-gcc-7.3-2.96.128
compat-gcc-c++-7.3-2.96.128
compat-libstdc++-7.3-2.96.128
compat-libstdc++-devel-7.3-2.96.128
openmotif21-2.1.30-8
setarch-1.3-1

Red Hat Enterprise Linux 4.0 and Asianux 2.0:
binutils-2.15.92.0.2-13.EL4
compat-db-4.1.25-9
compat-libstdc++-296-2.96-132.7.2
control-center-2.8.0-12
gcc-3.4.3-22.1.EL4
gcc-c++-3.4.3-22.1.EL44
glibc-2.3.4-2.9
glibc-common-2.3.4-2.9
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-22.1
libstdc++-devel-3.4.3-22.1
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
setarch-1.6-1

SUSE Linux Enterprise Server 9:
binutils-2.15.90.0.1.1-32.5
gcc-3.3.3-43.24
gcc-c++-3.3.3-43.24
glibc-2.3.3-98.28
gnome-libs-1.4.1.7-671.1
libstdc++-3.3.3-43.24
libstdc++-devel-3.3.3-43.24
make-3.80-184.1
pdksh-5.2.14-780.1
sysstat-5.0.1-35.1
xscreensaver-4.16-2.6

To check the available packages :
# rpm -q package_name
eg: # rpm -q gcc-3.2.3-34

Creating Required Operating System Groups and Users:
1. The OSDBA group (dba) - OS users who would be ORACLE DBAs (SYSDBA previlaged people).
2. The OSOPER group (oper) - OS users who would have limited DBA privilage (SYSOPER).
3. The Oracle Inventory group (oinstall)- Oracle inventory owner. Note: Oracle Inventory is the catalog of oracle software installed.
4. The Oracle software owner user ( oracle). Note:This user must have the Oracle Inventory group as its primary group. It must also have theOSDBA and OSOPER groups as secondary groups.
Steps for creating the Groups:
1. # /usr/sbin/groupadd oinstall
2. # /usr/sbin/groupadd dba
3. # /usr/sbin/groupadd oper
Creating an Oracle Software Owner User:

# /usr/sbin/useradd -g oinstall -G dba[,oper] oracle
-g -primary group
-G secondary group

Set the password of the oracle user:

# passwd oracle
input your password

Modifying an Oracle Software Owner User:
# /usr/sbin/usermod -g oinstall -G dba[,oper] oracle

Configuring Kernel Parameters:
The kernel parameters are used to determine the way Oracle software should behave the Linux operating system.
/proc/sys/kernel/sem
/proc/sys/kernel/shmall
/proc/sys/kernel/shmmax
/proc/sys/kernel/shmmni
/proc/sys/fs/file-max
/proc/sys/net/ipv4/ip_local_port_range
/proc/sys/net/core/rmem_default
/proc/sys/net/core/rmem_max
/proc/sys/net/core/wmem_default
/proc/sys/net/core/wmem_max

The values can be edited by

vi /etc/sysctl.conf

Ideal values should be the following or greater

kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

Add the following line to /etc/profile

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

Creating ORACLE Software installation Directories:

mkdir /u01/app /u01/app/oracle /u01/oradata
chown oracle:oinstall /u01/app /u01/app/oracle /u01/oradata
chmod 775 /u01/app /u01/app/oracle /u01/oradata


INSTALLATION OF ORACLE SOFTWARE:

Download the software from:

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

Run The following as ORACLE user, By logging into oracle user

UNZIP THE SOFTWARE :
1. unzip 10201_database_linux32.zip.
2. Navigate to the unzip-id folder
3. in the terminal run ./run_installer.
4. select the type of installation
5. give the directory structures
6. ORACLE UNIVERSAL INSTALLER prompts to run the scripts.
7. Run the Scripts as Root user
The output will be:

$ su - root
# /u01/app/oracle/product/10.1.0/db_1/root.sh
Running Oracle10 root.sh script...
\nThe following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.1.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ..
Copying coraenv to /usr/local/bin ...
\nCreating /etc/oratab file...
Adding entry to /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
/var/opt/oracle does not exist. Creating it now.
/etc/oracle does not exist. Creating it now.



Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Oracle Cluster Registry for cluster has been initialized
Adding to inittab
Checking the status of Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
mars
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
#
Click OK
- End of Installation:
Click Exit
After the installation is over the .bash_profile should be edited:

$ vi .bash_profile
export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
Here the input your oracle base directory structures.

After installation to make sure every thing works
connect to sqlplus and see.
sqlplus username/password as sysdba

ADDITIONAL INFORMATIONS:
To start Enterprise Manager:
In the terminal window
$ Emctl start

Finding listener status:
$ lsnrct status