… and continues with the configuration

March 22, 2012 — Leave a comment

We did the initial operating system setup in the last post. Before we can install the oracle software we need to prepare the operating system for oracle. I will assume your Virtual Machine is up and running and you have a working ssh connection established to it ( as user root ).

Because it is a training environment turn off the firewall and selinux

chkconfig iptables off
service iptables stop
vi /etc/sysconfig/selinux
## SELINUX=disabled 

The first requirement we need to fulfill is to install all the software packages oracle requires to successfully install. A list of the packages can be found in the oracle documentation.

yum install -y 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 libcap openssh-clients unzip numactl man-pages man

Documentation links:

Next we need to set the kernel parameters ( again, see the documentation for details ):

echo "fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 1024 65000
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
kernel.sem = 250 32000 32 1024 " >> /etc/sysctl.conf
/sbin/sysctl -p

For an excellent description of the shared memory parameters take a look at orafaq

As oracle will run under it’s own user accounts and groups we need to define them ( again, see the documentation for details )

/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 506 asmdba
/usr/sbin/groupadd -g 505 asmoper
/usr/sbin/useradd -u 502 -g oinstall -G asmadmin,asmdba,asmoper,dba -m -c "Grid Infratructure Software owner" grid
/usr/sbin/useradd -u 503 -g oinstall -G dba,oper,asmdba,asmadmin -m -c "Database Software owner" oracle
passwd oracle
passwd grid

Because Oracle will need resources from the OS, lets set the resource limits ( again, see the documentation for details )

echo "oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768" >> /etc/security/limits.conf

Make sure we have a correct hosts entry:

echo "10.0.2.15   oracleplayground oracleplayground.fun" >> /etc/hosts

Almost finished. What’s still missing are the directories for the Oracle Inventory ( the central location where oracle records the products installed ) and the software locations. For a description see the documentation.
Note: As this will be a training environment we will not create separate mount points as you would do on a production system.

mkdir /opt/oracle
mkdir /opt/oracle/stage
mkdir /opt/oracle/product
mkdir /opt/oracle/oraInventory
mkdir /opt/oracle/product/base
mkdir /opt/oracle/product/crs
chown grid:oinstall /opt/oracle
chown grid:oinstall /opt/oracle/stage
chown grid:oinstall /opt/oracle/product
chown grid:oinstall /opt/oracle/oraInventory
chown grid:oinstall /opt/oracle/product/crs
chown oracle:oinstall /opt/oracle/product/base
chmod 770 /opt/oracle
chmod 770 /opt/oracle/stage
chmod 770 /opt/oracle/oraInventory
chmod 770 /opt/oracle/product
chmod 770 /opt/oracle/product/base

That’s it. The OS is ready for the oracle installation.

To be prepared for the next step, you’ll need to download the below files from oracle support. On the “Patches and Updates” tab search for patches 10404530 and 13348650.

  • p10404530_112030_Linux-x86-64_1of7.zip: Oracle Database 11gR2 11.2.0.3 Part 1 of 2
  • p10404530_112030_Linux-x86-64_2of7.zip: Oracle Database 11gR2 11.2.0.3 Part 2 of 2
  • p10404530_112030_Linux-x86-64_3of7.zip: Oracle Grid Infrastructure 11gR2 11.2.0.3 Part 1 of 1
  • p13348650_112030_LINUX.zip: Oracle Grid Infrastructure Patchset Update 11.2.0.3.1 ( includes database PSU )

If you do not have an oracle support account you can go with the base release ( 11.2.0.1.0 ) which can be downloaded from Oracle Technology Network. The procedure for installing the software remains the same but you will not be able apply the PSU ( Patch Set Update ) from above.

For your convenience or if you’d like to automate the tasks performed in this post, here is the complete script:

#!/bin/bash
if [ $(id -un) != "root" ]; then
echo "you must run this as root"
exit 0
fi
# install the required software
yum install -y 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 libcap openssh-clients unzip numactl man-pages man
# set the kernel parameters
echo "fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 1024 65000
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
kernel.sem = 250 32000 32 1024 " >> /etc/sysctl.conf
/sbin/sysctl -p
# add groups and users
/usr/sbin/groupadd -g 501 oinstall
/usr/sbin/groupadd -g 502 dba
/usr/sbin/groupadd -g 503 oper
/usr/sbin/groupadd -g 504 asmadmin
/usr/sbin/groupadd -g 506 asmdba
/usr/sbin/groupadd -g 505 asmoper
/usr/sbin/useradd -u 502 -g oinstall -G asmadmin,asmdba,asmoper,dba -m -c "Grid Infratructure Software owner" grid
/usr/sbin/useradd -u 503 -g oinstall -G dba,oper -m -c "Database Software owner" oracle
passwd oracle
passwd grid
# set the resource limits
echo "oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768" >> /etc/security/limits.conf
# create the directories
mkdir /opt/oracle
mkdir /opt/oracle/stage
mkdir /opt/oracle/product
mkdir /opt/oracle/oraInventory
mkdir /opt/oracle/product/base
mkdir /opt/oracle/product/crs
chown grid:oinstall /opt/oracle
chown grid:oinstall /opt/oracle/stage
chown grid:oinstall /opt/oracle/product
chown grid:oinstall /opt/oracle/oraInventory
chown grid:oinstall /opt/oracle/product/crs
chown oracle:oinstall /opt/oracle/product/base
chmod 770 /opt/oracle
chmod 770 /opt/oracle/stage
chmod 770 /opt/oracle/oraInventory
chmod 770 /opt/oracle/product
chmod 770 /opt/oracle/product/base

Remember to take a snapshot of your Virtual Machine if you want to save your work or if you want to revert to this point:

vboxmanage snapshot oracleplayground take "after OS configuration"
Advertisements

No Comments

Be the first to start the conversation!

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