Oracle 11g Installation on LINUX

Oracle 11g Installation on LINUX

Step 1 – Download Software.

OTN: Oracle Database 11g Release 2 (11.2.0.1) Software (64-bit)

Step 2 – Unzip the files.

unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

Step 3 – Edit Hosts File

The “/etc/hosts” file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1       localhost.localdomain  localhost
192.168.2.181   ol5-11gr2.localdomain  ol5-11gr2

$uname –n à to check machine name
$dnsdomainname à to check the localdomain

Step 4 – Manual Setup

If you have not used the “oracle-validated” package to perform all prerequisites, you will need to manually perform the following setup tasks.

Oracle recommend the following minimum parameter settings.

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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

The current values can be tested using the following command.

/sbin/sysctl -a | grep <param-name>

Add or amend the following lines in the “/etc/sysctl.conf” file.

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

Run the following command to change the current kernel parameters.

/sbin/sysctl -p

Step 5 – Limit the oracle processes by editing the limits.conf file

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

Step 6 – Install the RPM dependencies
Install the following packages if they are not already present.

binutils-2.*
compat-libstdc++-33*.i386.rpm
elfutils-libelf*
gcc-4.*
gcc-c++-4.*
glibc-2.*
glibc-common-2.*
glibc-devel-2.*
glibc-headers-2.*
ksh*
libaio-0.*
libaio-devel-0.*
libgomp-4.*
libgcc-4.*
libstdc++-4.*
libstdc++-devel-4.*
make-3.*
sysstat-7.*
unixODBC-2.*
unixODBC-devel-2.*
numactl-devel-*

Step 7 – Create Users and Groups

#groupadd oinstall
#groupadd dba
#groupadd oper
#groupadd asmadmin

Add oracle user and assigning oinstall as primary group and others as secondary

#useradd -g oinstall -G dba,oper,asmadmin oracle
#passwd oracle

#id oracle

Step 8 – Additional Setup (Optional)

The following setup tasks must be performed regardless of which setup method you used previously.

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

SELINUX=disabled

Step 9 – Create directories for oracle installation  


#df –kh (For checking Memory Space)

//Creating Oracle Base

#mkdir -p /u01/app/oracle
#chown -R oracle:oinstall /u01/app/oracle
#chmod -R 775 /u01/app/oracle

//Create OracleInventory

#mkdir -p /u01/app/oraInventory

#chown -R oracle:oinstall /u01/app/oraInventory/

#chmod -R 775 /u01/app/oraInventory/

//Creating Oracle Home

#mkdir -p /u01/app/oracle/product/11.2.0/db_home

#chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_home/

#chmod -R 775 /u01/app/oracle/product/11.2.0/db_home/


Note:
/u01/app/oracle/= ORACLE_BASE
/u01/app/oracle/product/11.2.0/db_home/= ORACLE_HOME


Step 10 – add host names to the list allowed to make connections to the X server

Login as root and issue the following command.

xhost +<machine-name>

Step 11 – Edit the bash profile

Login as the oracle user and add the following lines at the end of the “.bash_profile” file, remembering to adjust them for your specific installation.

$vi .bash_profile

export ORACLE_BASE= /u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_home

export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

:wq!

$ . . bash_profile


(optional)
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=ol5-112.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/opt/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=test_db; 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

Step 12 – Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

#grep `hostname` /etc/hosts (to know the ip-address of the host machine)

Error? How do I resolve this Xhost/Display error?

You just set your DISPALY variable after switching to oracle user from root(# su – oracle). After seeing this $ prompt set this variable. $ DISPLAY=<your IP address of local Machine:0.0>; export DISPLAY. Actual command is $ DISPLAY=10.0.0.1:0.0; export DISPLAY then run runInstaller script from your CDROM or DVD mount point.

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

$ ./runInstaller or $sh runInstaller

Step 13 – Post Installation

Edit the “/etc/oratab” file setting the restart flag for each instance to ‘Y’.
DB11G:/u01/app/oracle/product/11.2.0/db_1:Y

Note:To change ownership of a folder in unix@root user

Chown –v <username> foldername

Ex: chown –v oracle opt

$ Sqlplus –v (shows version of oracle s/w)

$cd $ORACLE_HOME/bin

$file oracle

Note:If error ‘error in invoking target ‘install’ of makefile ins_ctx.mk’ (install the below package by connecting to the internet.

# yum install compat-libstdc++-33

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: