Search This Blog

Thursday 15 January 2015

Oracle Installtion on linux

Oracle 11g Installation on Linux

This post assumes that you have already installed Red Hat Enterprise Linux 5. (Cent OS 5can also be used for this purpose.)

1) First we will add groups by running the following commands.
groupadd oper
groupadd dba
groupadd oinstall
groupadd asmadmin

Note. We are not going to use the "asmadmin" group, since this installation will not use ASM.


2) Then we will add user oracle, with primary group Oninstall & secondary group G dba,oper  oracle

useradd -g oinstall -G dba,oper  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/11.2.0/db_1

6) Give permissions to the above created folder.

chmod -R 777 /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

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586




after making the required changes quit the vi editor and run the following command as the root user.
The current values can be tested using the following command.
/sbin/sysctl -a | grep <param-name>


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

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

vi /etc/security/limits.conf

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240


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
ORACLE_HOSTNAME=admin.localdomain; export ORACLE_HOSTNAME

ORACLE_UNQNAME=DBID; 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=SID; export ORACLE_SID

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/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
------------------------------------------------------------------------------------------------------------------------------------------------

save the information # some changes in bash_profiles are you can set ORACLE_HOSTNAME ="as per your machine" host name find in you machine through hostname comand on linux by degault u get localhost.localdoamin so u set localhost.localdomain

Set ORACLE_UNQNAME=DBID that we want. like ORACLE_UNQNAME=orcl11g;
Set ORACLE_SID=SID that we want like ORACLE_SID=orcl,

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/unzip the oracle database files in that folder.

How to unzip the folder

Go to file location n just type unzip (file_ location)


open a new command prompt

chmod -R 777 /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 "dba" and remove the tick from
the create starter database.

2nd screen

change the group for orainventory to "dba".


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.


No comments:

Post a Comment