Search This Blog

Tuesday, July 20, 2010

Oracle 10g Installation on Linux

This post assumes that you have already installed Red Hat Enterprise Linux 4. (Cent OS 4 can also be used for this purpose.)
1) First we will add groups by runing the following commands.
groupadd oper
groupadd dba
groupadd oinstall


2) Then we will add user oracle, with primary group dba & secondary group oinstall.

useradd -g dba -G oinstall oracle

3) Then we will assign password to this user. The password assigned to this user is oracle however you can choose your own password.

passwd oracle

4) Then we will run xhost command which enables access to the X server which runs on linux. The main purpose of this server is to enable and run GUI applications in a networking mode.(This command should be run as the root user when the oracle software is to be installed or when the dbca utility is to be used.)

xhost + (it will give you a message like access control disabled ------- and so on. Don't worry its a message not a error.)

5) Now we will make a directory for all the oracle components.

mkdir -p /u01/app/oracle/product/10.2.0/db_1

6) Give permissions to the above created folder.

chmod -R 775 /u01

7) Choose the owner and group for that folder.

chown -R oracle:oinstall /u01

8) Open the following file and add the kernel parameters to the last line.

vi /etc/sysctl.conf ## open file syntax

kernel.shmall = 2097152
kernel.shmmax = 536870912
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=262144
net.core.wmem_default=262144
net.core.rmem_max=262144
net.core.wmem_max=262144

after making the required changes quit the vi editor and run the following command as the root user.

/sbin/sysctl -p ## gives you a printout of all the parameters in the sysctl file.

9) Open the following file and add the parameter to the second last line.

vi /etc/pam.d/login ## open file syntax

session required /lib/security/pam_limits.so


10) Open this file and add the parameters at the end.

vi /etc/security/limits.conf

* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536



11) Setting up the bash profile.

su - oracle ##switch to oracle user from the root user

vi .bash_profile ## open the oracle users bash profile.

d ## press the "d" key to delete all the contents of the file.

i ## go into insert mode

copy all the information below and paste it into the bash profile.

------------------------------------------------------------------------------------------------------------------------------------------------
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
       . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME
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

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

save the information

exit ## exit from the oracle user prompt.



su - oracle ## Then again switch to the oracle user. If at this stage after switching if there is any error check the bash profile for typographical error.

12) Now we are ready to install the oracle software.


make a folder in the /u01 folder as "soft" and copy the oracle database files in that folder.

open a new command prompt

chmod -R 775 /u01 ## again give permissions.

xhost + ## required to run the oracle installation.

su - oracle

cd /u01/soft/database ## go to the oracle directory.

ls -l ## check the directory contents.

./runInstaller ## Initiate the installation process.


13) oracle setup values.

1st screen

choose the enterprise edition change the group to "oinstall" and remove the tick from
the create starter database.

2nd screen

change the group for orainventory to "oinstall".


14) final step
when the oracle installation is finished it will ask you to run
two scripts as the root user.

open a new terminal and run the scripts exactly as they are written one by one.


after running the scripts click ok and exit the enterprise manager.
now your oracle software installation is finished.


15) Time to create a database.


as the root user do the following:-

xhost + ## required to run the dbca utility

su - oracle

dbca

in the dbca utility in the template section choose the "general purpose" template. Also in the schemas section you can choose the install sample schemas.
Then give the sid name to the database (i usually give orcl, but you can choose any name you want.)
other than the above changes don't change any other variables, keep on clicking next and finally hit the finish button.
So now we have created our first database.

6 comments:

  1. yeah... sir!! good one.. easily understandable:)

    ReplyDelete
  2. yeah it was the simplest and the best technical blog ever read by me. Thanks a lot for this wonderful blog. By GAUTAM

    ReplyDelete
  3. A beginner can also install the oracle on unix

    by :-- AMIT

    ReplyDelete
  4. its very simple to learn for beginers, thank u alot...


    rakesh dba

    ReplyDelete