Oracle 11g Database with ASM grid installation in Oracle Enterprise Linux 7

Oracle 11g Database with ASM grid installation in Oracle Enterprise Linux 7

Login with root user (All prerequisites should be completed by root user only) 

1) Create groups for oracle user

groupadd dba
groupadd oinstall
groupadd oper

2) Create groups for ASM instance (grid user)

groupadd asmadmin
groupadd asmdba
groupadd asmoper

3) Create users

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

4) Set the password for Users

passwd oracle
passwd grid

5) Create Directory structure for Oracle and Grid Software installation

mkdir -p /u01/app/oracle/product/11.2.0/db_1
mkdir -p /u01/app/grid/product/11.2.0/grid

6) Change Owner and group on Directory structure

chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid/product/11.2.0/grid

7) Give permissions on Directory structure

chmod -R 775 /u01

8) Set the system kernel parameters

cat >> /etc/sysctl.conf << EOF
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 = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
EOF
 
See the parameters using below command
/sbin/sysctl -p

9) Now setup the resource LIMIT for oracle and grid users

cat >> /etc/security/limits.conf << EOF
oracle      soft         nproc      2047
oracle      hard        nproc      16384
oracle      soft         nofile      4096
oracle      hard        nofile      65536
oracle      soft         stack       10240
grid         hard        nofile      65536
EOF

10) Set the .bash_profile parameters for oracle user

cat>>/home/oracle/.bash_profile<
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
export JAVA_HOME=/usr/local/java
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
PATH=.:${JAVA_HOME}/bin:${PATH}:$ORACLE_HOME/binPATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
umask 022
EOF
   
Set the .bash_profile parameters for grid user

cat>>/home/grid/.bash_profile<
export ORACLE_SID=+ASM
export JAVA_HOME=/usr/local/java
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/grid/product/11.2.0/grid
PATH=:${JAVA_HOME}/bin:${PATH}:$ORACLE_HOME/binPATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/u01/app/common/oracle/bin:$ORACLE_HOME/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:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
umask 022
EOF

11) Now configure the global profile settings run as a root user

cat >> /etc/profile << EOF
if [ \$USER = "oracle" ]; then
if [ \$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF
 
cat >> /etc/csh.login << EOF
if ( \$USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
umask 022
endif
EOF

12) Now  adding 3 hard disks using VMware

 Go into VM=>settings=>add=>select hardisk=>next=>select scsi=>create a new virtual disk=>maximum disk size(GB): 10=>next=>finish,
After adding hard drives

we need to reboot the system for mounting the hard disks, alternatively you can avoid rebooting, by following the below command.
echo "- - -"> /sys/class/scsi_host/host0/scan (check host file in /sys/class/scsi_host/)

check with below command

fdisk -l

13) Now create the partition of all three hard disk

fdisk /dev/sdb

  ==>n (For Add new disk) ==> p (For primary partition) Enter ==> (Partition number) Enter ==> (First cylinder) Enter ==>(First cylinder) Enter ==>w (For Write disk information and exit)

For reference please check the below screen-shot 




fdisk /dev/sdc

==>n (For Add new disk) ==> p (For primary partition) Enter ==> (Partition number) Enter ==> (First cylinder) Enter ==>(First cylinder) Enter ==>w (For Write disk information and exit)

fdisk /dev/sdd

==>n (For Add new disk) ==> p (For primary partition) Enter ==> (Partition number) Enter ==> (First cylinder) Enter ==>(First cylinder) Enter ==>w (For Write disk information and exit)


Check that the expected partitions exist by below command

cat /proc/partitions





14) Now set the permissions for hard drives

chown grid:asmadmin /dev/sdb1
chmod 660 /dev/sdb1
chown grid:asmadmin /dev/sdc1
chmod 660 /dev/sdc1
chown grid:asmadmin /dev/sdd1
chmod 660 /dev/sdd1

Note: – make sure these software must be installed in your system for configuring ASM Disk

rpm -Uvh oracleasm-sumport-2.0.1-1.i386.rpm
rpm -Uvh oracleasmlib-2.0.1-1.i386.rpm
rpm -Uvh oracleasm-2.6.9-34.ELsmp-2.0.1-1.i686.rpm
rpm -Uvh libaio-devel-0.3.106*
rpm -Uvh sysstat-7.0.2*
rpm -Uvh unixODBC-2.2.11*
rpm -Uvh unixODBC-devel-2.2.11*

Configure ASM & create ASM disk :-
Configure (For configuring ASM, ruining below command)

/usr/sbin/oracleasm configure -I
=========================================================
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

The next two configuration options take substrings to match device names.
The substring "sd" (without the quotes), for example, matches "sda", "sdb",
etc.  You may enter more than one substring pattern, separated by spaces.
The special string "none" (again, without the quotes) will clear the value.

Device order to scan for ASM disks []: sd
Devices to exclude from scanning []:
Use device logical block size for ASM (y/n) [n]:
Writing Oracle ASM library driver configuration: done
==========================================================
oracleasm configure -i
==========================================================
Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
==========================================================

 Take a restart of Linux system

Check the drives created by below command

ls -ltr /dev/sd*
===================================================
[root@oracle Desktop]# ls -l /dev/sd*
brw-rw----. 1 root disk 8,  0 May 19  2017 /dev/sda
brw-rw----. 1 root disk 8,  1 May 19  2017 /dev/sda1
brw-rw----. 1 root disk 8, 16 May 19 00:18 /dev/sdb
brw-rw----. 1 root disk 8, 17 May 19 00:23 /dev/sdb1
brw-rw----. 1 root disk 8, 32 May 19 00:16 /dev/sdc
brw-rw----. 1 root disk 8, 34 May 19 00:24 /dev/sdc2
brw-rw----. 1 root disk 8, 48 May 19 00:16 /dev/sdd
brw-rw----. 1 root disk 8, 51 May 19 00:24 /dev/sdd3
=====================================================

Create ASM DISK :-

oracleasm createdisk DATA1 /dev/sdb1
oracleasm createdisk DATA2 /dev/sdc1
oracleasm createdisk DATA3 /dev/sdd1
oracleasm createdisk DATA4 /dev/sdd1















Check now disks are available

 







Also check the the disks are mounted in the oracleasm filesystem by below command

ls -l /dev/oracleasm/disks


Make a directory using below commands and gives appropriate permissions.

mkdir /oracle
chown -R oracle:oinstall /oracle
chmod -R 775 /oracle

Now copy the GRID software from grid user and RDBMS software from oracle user in /oracle folder

Login with grid user and unzip grid software

cd /oracle
unzip linux.x64_11gR2_grid.zip
cd grid

Now start the installation of grid software

./runInstaller 


After completion of grid installation Login with oracle user and unzip RDBMS software

cd /oracle
unzip linux_11gR2_database_1of2.zip
unzip linux_11gR2_database_2of2.zip

cd database

Now start the installation of rdbms software

No comments:

Post a Comment