Install Oracle 11.2.0.3 with ASM on Centos 6.3

For RHEL 6, Oracle will provide ASMLib software and updates only when configured with a kernel distributed by Oracle. Oracle will not provide ASMLib packages for kernels distributed by Red Hat as part of RHEL 6. ASMLib updates will be delivered via Unbreakable Linux Network (ULN), which is available to customers with Oracle Linux support. ULN works with both Oracle Linux or Red Hat Linux installations, but ASMLib usage will require replacing any Red Hat kernel with a kernel provided by Oracle.

Because of the above announcement we use UDEV rules to prepare disks for ASM installation.

So let’s start.

1. Install required RPMs.

RPM names:

compat-libcap1-1.10-1.i686.rpm
compat-libcap1-1.10-1.x86_64.rpm
compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
elfutils-devel-0.152-1.el6.x86_64.rpm
elfutils-libelf-devel-0.152-1.el6.x86_64.rpm
gcc-c++-4.4.6-4.el6.x86_64.rpm
glibc-2.12-1.80.el6.i686.rpm
glibc-devel-2.12-1.80.el6.i686.rpm
libaio-0.3.107-10.el6.i686.rpm
libaio-devel-0.3.107-10.el6.x86_64.rpm
libattr-2.4.44-7.el6.i686.rpm
libcap-2.16-5.5.el6.i686.rpm
libgcc-4.4.6-4.el6.i686.rpm
libstdc++-devel-4.4.6-4.el6.x86_64.rpm
libtool-ltdl-2.2.6-15.5.el6.i686.rpm
ncurses-devel-5.7-3.20090208.el6.i686.rpm
ncurses-libs-5.7-3.20090208.el6.i686.rpm
nss-softokn-freebl-3.12.9-11.el6.i686.rpm
pdksh-5.2.14-30.x86_64.rpm
readline-6.0-4.el6.i686.rpm

If you have Centos installation disk, these RPMs should be locate there. Or you can download them from  http://rpm.pbone.net/

Note: if during installing pdksh-5.2.14-30.x86_64.rpm it says that package conflicts with ksh then you should erase ksh package and install pdksh, like this:

# rpm -qa | grep ksh
# rpm -e ksh-…
# rpm –ivh pdksh-5.2.14-30.x86_64.rpm

2. Configure Kernel:

# vi /etc/sysctl.conf

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

To make changes take effect:

# sysctl –p

Edit /etc/pam.d/login :

# vi /etc/pam.d/login

session required pam_limits.so

Edit /etc/security/limits.conf:

# vi /etc/security/limits.conf

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

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

Run the following to add lines in /etc/pam.d/login:

[root@orcl ~]# cat >> /etc/pam.d/login <<EOF
session required pam_limits.so
EOF

Run the following to add lines in /etc/profile:

[root@orcl ~]# cat >> /etc/profile <<EOF
if [ \$USER = "oracle" ] || [ \$USER = "grid" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF

Run the following to add lines in /etc/csh.login

[root@orcl ~]# cat >> /etc/csh.login <<EOF
if ( \$USER == "oracle" || \$USER == "grid" )
then
limit maxproc 16384
limit descriptors 65536
endif
EOF

Disable SELinux:

# /usr/sbin/getenforce
Enforcing

# /usr/sbin/setenforce 0

To make changes permanent, change /etc/sysconfig/selinux file by the following way:

cat /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing – SELinux security policy is enforced.
#     permissive – SELinux prints warnings instead of enforcing.
#     disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted – Targeted processes are protected,
#     mls – Multi Level Security protection.
SELINUXTYPE=targeted

To check the status again:

# /usr/sbin/getenforce
Disabled

3.  Creating OS groups and users.

#Creating groups for Grid Infrastructure

groupadd asmadmin
groupadd asmdba
groupadd asmoper

#Creating groups for Oracle Software

groupadd oinstall
groupadd dba
groupadd oper

#Creating user for Grid Infrastructure

useradd -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid grid

#Creating user for Oracle Software

useradd -g oinstall -G dba,oper,asmdba -d /home/oracle oracle

#Setting password for users

passwd grid
passwd oracle

4. Creating necessary directories

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

5. Creating .bash_profile-s

#For Oracle user

su – oracle
vi .bash_profile

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

ORACLE_SID=orcl; export ORACLE_SID

ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME

JAVA_HOME=/usr/local/java; export JAVA_HOME

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_HOME

ORACLE_TERM=xterm; export ORACLE_TERM

NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"
export NLS_DATE_FORMAT

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin
export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH

THREADS_FLAG=native; export THREADS_FLAG

export TEMP=/tmp
export TMPDIR=/tmp

umask 022

#For Grid user

su – grid
vi .bash_profile

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

ORACLE_SID=+ASM; export ORACLE_SID

JAVA_HOME=/usr/local/java; export JAVA_HOME

ORACLE_BASE=/u01/app/grid; export ORACLE_BASE

ORACLE_HOME=/u01/app/11.2.0/grid; export ORACLE_HOME

ORACLE_TERM=xterm; export ORACLE_TERM

NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT

TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN

ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11

PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin
export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH

CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH

THREADS_FLAG=native; export THREADS_FLAG

export TEMP=/tmp
export TMPDIR=/tmp

umask 022

 

6. Add disks for ASM

If your disk is not partitioned yet, partition it by fdisk utility.

At this point you will need SCSI identifier.

So if your disk is physical just run the following command to identify it:

# scsi_id -g -u -d /dev/sdb
36000c292dfddac7b8934d3293313098e

Or if you have virtual disk , you will need to set disk.EnableUUID parameter to TRUE to see this identifier:

Shutdown VM, go to the directory where VM files are stored and edit VMX file. Add the following line:

disk.EnableUUID = "TRUE"

Restart your VM and run the above command (scsi_id -g -u -d /dev/sdb)

We will use this identifier for the UDEV rules to set permissions and alias for the new device in /etc/udev/rules.d/50-udev.rules file.

# vi /etc/udev/rules.d/50-udev.rules

KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",
RESULT=="36000c292dfddac7b8934d3293313098e", NAME="oracleasm/asm-disk1",
OWNER="oracle", GROUP="dba", MODE="0660"

Restart udev, by the following way:

# /sbin/start_udev
Starting udev:                                             [  OK  ]

Check that alias exists:

# ls -la /dev/oracleasm/*
brw-rw—- 1 oracle dba 8, 17 Feb 18 12:49 /dev/oracleasm/asm-disk1

7. Install grid

Go to the grid installation folder and run:

./runInstaller

Step 1:

Skip Software Updates.

Step 2:

Configure Oracle Grid Infrastructure for a Standalone Server.

Step 3:

Click Next.

Step 4:

Select the Change Discovery Path button and enter /dev/oracleasm.

There should appear /dev/oracleasm/asm-disk-1 and check it.

Type disk group name as DATA01.

Step 5:

Set the passwords for the SYS and ASMSNMP accounts:

Step 6:

ASM Database Administrator(OSDBA) Group : asmdba
ASM Instance Administration Operator(OSOPER) Group: asmoper
ASM Instance Administrator(OSASM) Group: asmadmin

Step 7:

Click Next.

Step 8:

Click Next.

Step 9:

Click Install.

After pop-upping the window , asking to run

      • /u01/app/oraInventory/orainstRoot.sh
  • /u01/app/oracle/product/11.2.0/db_1/root.sh

run these scripts one by one and click OK on pop-up window.

Note: if root.sh script shows the error like this:

…error while loading shared libraries: libcap.so.1: …

Then in your system libcap-1 and libcap-2 RPMs are missing, first install them.

8. Install database

Go to the database installation folder and run:

./runInstaller

Step 1:

I don’t want any more spam thanks.

Step 2:

Skip the updates.

Step 3:

Create and configure a database.

Step 4:

Server Class.

Step 5:

Single instance database installation.

Step 6:

Advanced install.

Step 7:

Choose the languages you want.

Step 8:

Enterprise Edition.

Step 9:

Choose the defaults.
Note: Grid and Database must be in the different folders.

Step 10:

General Purpose / Transaction Processing.

Step 11:

Write a database name.

Step 12:

Use Oracle Enterprise Manager Database Control for database management.

Step 13:

Use Automatic Storage Management.

Step 15:

Do not enable automated backups

Step 16:

Select the DATA01 diskgroup.

Step 17:

Set the passwords for the database.

Step 18:

Accept the defaults.

Database Administrator(OSDBA) Group: dba
Database Operator(OSOPER) Group: oper

Step 19:

Click Install to start the installer.

After the installation requires to run root.sh script, run it.

That is all.

Advertisement

About Mariami Kupatadze
Oracle Certified Master Linkedin: https://www.linkedin.com/in/mariami-kupatadze-01074722/

5 Responses to Install Oracle 11.2.0.3 with ASM on Centos 6.3

  1. adolfo says:

    Under which user I must install grid?

  2. yaser says:

    Under which user I must install oracle?

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: