نصب اوراکل ASM 11gR2 روی لینوکس ۶

 

Oracle 11g Release 2 (11.2.0.4) Install Grid Infrastructure installation on Linux 6.x 64bit

******************************* step 1 ********************************************
This article describes the installation of Oracle Database 11g Release 2 (11.2) (64-bit) on Oracle Linux 6 (64-bit). The article is based on a server installation with a minimum of 2G swap, with both SELinux and the firewall disabled. The following package groups were included for this installation.

Base System > Base
Base System > Client management tools
Base System > Compatibility libraries
Base System > Hardware monitoring utilities
Base System > Large Systems Performance
Base System > Network file system client
Base System > Performance Tools
Base System > Perl Support
Servers > Server Platform
Servers > System administration tools
Desktops > Desktop
Desktops > Desktop Platform
Desktops > Fonts
Desktops > General Purpose Desktop
Desktops > Graphical Administration Tools
Desktops > Input Methods
Desktops > X Window System
Development > Additional Development
Development > Development Tools
Applications > Internet Browser

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

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

For example.

۱۲۷٫۰٫۰٫۱ localhost.localdomain localhost

۱۹۲٫۱۶۸٫۵۶٫۲۰ oradbasm.oraclekade.me oradbasm

test network:
# ping oradbasm

*****************************************************************************
Check OS Software Requirements: in all nodes (root user)

for downloading i686 packages user :

https://www.rpmfind.net/linux/rpm2html/search.php

yum -y install binutils
yum -y install compat-libstdc++-33
yum -y install elfutils-libelf
yum -y install elfutils-libelf-devel
yum -y install gcc
yum -y install gcc-c++
yum -y install glibc
yum -y install kernel-devel
yum -y install glibc-common
yum -y install glibc-devel
yum -y install glibc-headers
yum -y install libaio
yum -y install libaio-devel
yum -y install libgcc
yum -y install libstdc++
yum -y install libstdc++-devel
yum -y install make
yum -y install numactl
yum -y install numactl-devel
yum -y install sysstat
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install libcap-2*
yum -y install compat-libcap1*
yum -y install pdksh

yum -y install glibc.i686
yum -y install glibc-devel.i686
yum -y install libaio.i686
yum -y install libaio-devel.i686
yum -y install compat-libstdc++-33.i686
yum -y install libgcc.i686
yum -y install libstdc++.i686
yum -y install libstdc++.i686
yum -y install unixODBC.i686
yum -y install unixODBC-devel.i686

yum -y install chrony

yum install -y kernel-debug
yum install -y kmod-oracleasm
yum install -y oracleasm-support
yum install -y oracleasmlib

********************************************************************************************************
. For checking Installed packeges:

rpm -q –qf ‘%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n’ binutils \
compat-libstdc++-33 \
elfutils-libelf \
elfutils-libelf-devel \
gcc \
gcc-c++ \
glibc \
glibc-devel \
kernel \
kernel-devel \
kernel-debug \
glibc-common \
glibc-devel \
glibc-headers \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
make \
numactl \
numactl-devel \
sysstat \
unixODBC \
unixODBC-devel \
libcap \
compat-libcap1 \
pdksh \
libgcc \
libstdc++ \
chrony \
kmod-oracleasm \
oracleasm-support \
oracleasmlib

*****************************************************************
stop NTP service in all nodes by root and configure chrony

service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.org
rm /var/run/ntpd.pid

if you using NTP, you must add the “-x” option into the following line in the /etc/sysconfig/ntpd file.
OPTIONS=”-x -u ntp:ntp -p /var/run/ntpd.pid”
[root@oradbasm etc]# service ntps restart

————————————————————–
. open below file and add NTP server’s IP after line below
. # Please consider joining

# vim /etc/chrony.conf

# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 192.168.56.1 iburst

# Serve time even if not synchronized to any NTP server.
local stratum 10

# Specify key number for command authentication.
#commandkey 1

# Generate new command key on start if missing.
#generatecommandkey

*****************************************************************
add line below to /etc/security/limits.conf in all nodes by root

grid soft nproc 16384
grid hard nproc 16384
grid soft nofile 65536
grid hard nofile 65536
grid soft stack 10240
grid hard stack 10240

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

*****************************************************************
add following lines to /etc/pam.d/login in all nodes by root

session required pam_limits.so

*****************************************************************
add the following lines to the /etc/profile in all nodes by root

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

*****************************************************************
edit fiel /etc/sysctl.conf

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

Run the following command to change the current kernel parameters.

/sbin/sysctl -p

*****************************************************************

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

SELINUX=disabled

Once the change is complete, restart the server.

*****************************************************************
Before installing the software, complete the following procedure to verify that the user nobody exists on both Oracle RAC nodes:
To determine if the user exists, enter the following command:

[root@oradbasm ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)

If this command displays information about the nobody user, then you do not have to create that user.

If the user nobody does not exist, then enter the following command to create it:

[root@oradbasm ~]# /usr/sbin/useradd nobody
Repeat this procedure on all the other Oracle RAC nodes in the cluster

*****************************************************************

create groups and user in all nodes by root

[root@oradbasm ~]#
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 505 asmdba
groupadd -g 506 asmoper

useradd -u 501 -g oinstall -G asmadmin,asmdba,asmoper,dba grid

useradd -u 502 -g oinstall -G dba,oper,asmdba oracle

[root@oradbasm ~]# passwd oracle
Changing password for user oracle.
New UNIX password: xxxxxxxxxxx
Retype new UNIX password: xxxxxxxxxxx
passwd: all authentication tokens updated successfully.

[root@oradbasm ~]#passwd grid
Changing password for user grid.
New UNIX password: xxxxxxxxxxx
Retype new UNIX password: xxxxxxxxxxx
passwd: all authentication tokens updated successfully.

*****************************************************************
configure .bash_profile for grid

export ORACLE_SID=+ASM
export JAVA_HOME=/usr/local/java
export ORACLE_BASE=/gridbase
export ORACLE_HOME=/grid/product/11.2.0/grid
#export ORACLE_PATH=/oracle/common/oracle/sql
export ORACLE_TERM=xterm
#export NLS_DATE_FORMAT=”DD-MON-YYYY HH24:MI:SS”
#export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS11=$ORACLE_HOME/nls/data
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/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

export THREADS_FLAG=native

export TEMP=/tmp
export TMPDIR=/tmp

umask 022

*****************************************************************
configure profile for oracle

export ORACLE_SID=orclasm
export ORACLE_UNQNAME=orcl
export JAVA_HOME=/usr/local/java
export ORACLE_BASE=/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
#export ORACLE_PATH=/app/common/oracle/sql
#export SQLPATH=/app/common/oracle/sql
export ORACLE_TERM=xterm
#export NLS_DATE_FORMAT=”DD-MON-YYYY HH24:MI:SS”
#export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS11=$ORACLE_HOME/nls/data
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
#PATH=${PATH}:/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

export THREADS_FLAG=native
export TEMP=/tmp
export TMPDIR=/tmp

umask 022

*****************************************************************

[root@oradbasm ~]#
mkdir /oraInventory
mkdir /gridbase
mkdir /oracle
mkdir /grid

chown -R grid:oinstall /grid
chown -R grid:oinstall /gridbase
chown -R oracle:oinstall /oracle
chown -R grid:oinstall /oraInventory

chmod -R 775 /grid
chmod -R 775 /oracle

*****************************************************************
. Configure ASMLib using the following command in all nodes

[root@oradbasm /]# oracleasm configure -i

Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [y]: Y
Scan for Oracle ASM disks on boot (y/n) [y]: Y
Writing Oracle ASM library driver configuration: done

c) load the kernel modual using the following command in all nodes

[root@oradbasm software]# oracleasm init

*****************************************************************
Configure ASM disk groups by root on node (rac1)
for watching partitions:
[root@oradbasm ~]# fdisk -l

Disk /dev/sdd: 1073 MB, 1073741824 bytes
۲۵۵ heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

for example there are below devices :
/dev/sdc , /dev/sdd, /dev/sde,/dev/sdf, /dev/sdg, /dev/sdh, /dev/sdi, /dev/sdj, /dev/sdk

[root@oradbasm ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won’t be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sdc: 1073 MB, 1073741824 bytes
۲۵۵ heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Repeate create partition for another device like 12-1

For reusing a disk you should formatting exists device.Use command below for all devices including (/dev/sdd1,/dev/sde1,/dev/sdf1,/dev/sdg1,/dev/sdf1,/dev/sdi1)

[root@oradbasm ~]# dd if=/dev/zero of=/dev/sdc1 bs=8192 count=10000

****************************************************************
Create diskgroup for ASM in olny node1
create diskgroup for OCR and Voting disk

[root@oradbasm ~]# oracleasm createdisk ocr1 /dev/sdc1
[root@oradbasm ~]# oracleasm createdisk ocr2 /dev/sdd1
[root@oradbasm ~]# oracleasm createdisk ocr3 /dev/sde1
[root@oradbasm ~]# oracleasm createdisk ocr4 /dev/sdf1
[root@oradbasm ~]# oracleasm createdisk ocr5 /dev/sdg1

[root@oradbasm ~]# oracleasm createdisk DATA1 /dev/sdh1
[root@oradbasm ~]# oracleasm createdisk DATA2 /dev/sdi1

[root@oradbasm ~]# oracleasm createdisk FAR2 /dev/sdj1
[root@oradbasm ~]# oracleasm createdisk FAR3 /dev/sdk1
[root@oradbasm ~]# oracleasm createdisk FAR1 /dev/sdl1

[root@oradbasm ~]# oracleasm scandisks
[root@oradbasm ~]# oracleasm listdisks

Scan disks in another nodes

[root@oradbasm ~]# oracleasm scandisks

[root@oradbasm ~]# oracleasm listdisks

For seeing which disk belongs to diskgroup:

[root@oradbasm]# oracleasm listdisks | xargs oracleasm querydisk -p

*****************************************************************
Download Software www.oracle.com

Download the Oracle software from OTN or MOS depending on your support status.

OTN: Oracle Database 11g Release 2 (11.2.0.1) Software (64-bit) – For unsupported installation.
MOS: Oracle Database 11g Release 2 (11.2.0.4) Software (64-bit) – For supported installation.

The files.

# ۱۱٫۲٫۰٫۱
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
linux.x64_11gR2_database_3of2.zip

#۱۱٫۲٫۰٫۲
p10098816_112020_Linux-x86-64_1of7.zip
p10098816_112020_Linux-x86-64_2of7.zip
p10098816_112020_Linux-x86-64_3of7.zip

#۱۱٫۲٫۰٫۳
p10404530_112030_Linux-x86-64_1of7.zip
p10404530_112030_Linux-x86-64_2of7.zip
p10404530_112030_Linux-x86-64_3of7.zip

#۱۱٫۲٫۰٫۴
p13390677_112040_Linux-x86-64_1of7.zip
p13390677_112040_Linux-x86-64_2of7.zip
p13390677_112040_Linux-x86-64_3of7.zip

[root@oradbasm ]# chmod 775 -R /software
[root@oradbasm ]# cd /software
[root@oradbasm software ]# unzip p13390677_112040_Linux-x86-64_1of7.zip
[root@oradbasm software ]# unzip p13390677_112040_Linux-x86-64_2of7.zip
[root@oradbasm software ]# unzip p13390677_112040_Linux-x86-64_3of7.zip

[root@oradbasm ]# chown grid:oinstall -R /software/grid
[root@oradbasm ]# chown oracle:oinstall -R /software/database

In graphical mode
delete of files in /tmp in all nodes
[root@oradbasm ~]# cd /tmp
[root@oradbasm ~]# rm -rf *

ready for installing
[root@oradbasm ~]# xhost +
[root@oradbasm ~]# su – grid
[grid@rac1 ~]$ cd /software/grid/
[grid@rac1 grid]$ ./runInstaller

a) Select “Install and Configure Grid Infrastructure for a Cluster”

b) Select “Advanced Installation”

c) Select languaage and click next

d) Cluster Name: rac-cluster
SCAN Name : rac-scan.example.com
SACN Port: 1521
uncheck Configure GNS

e) click “Add” button and then
Hostname: rac2.example.com
Virtual IP Name : rac2-vip.example.com

f) click “SSH Connectivity” button
OS Password for grid: ********

g) click “Setup” button you should see message below:
“Successfully established password SSH connectivity between the selected nodes” and the click Next
if you see an error please change password for grid’s user in all nodes and then try again. for changing passwod use command below:

[root@oradbasm ~]# passwd grid
Changing password for user grid.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.

h) you should see like below:

Interface Name Subnet Interface Type
——————————————————————————
eth0 10.0.0 Public
eth1 192.168.0.0 Private

i) Select “Automatic Storage Management (ASM)”

j) Disk Group Name: CRS
Redundancy: External
Disk Path choose : ORCL:CRS1 and ORCL:CRS2
if you have problem to watching disks press “Change Disconvery Path” and type “/dev/oracleasm/*/*” and then press OK;

k) choose “Use same passwords for these accounts”.

l) Select “Do not use Intelligent Platform Management Interface (IPMI)”.

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

n) Oracle Base : /grid
Software Location: /grid/product/11.2.0/grid

o) Inventory Directory: /oraInventory
oraInventory Group Name: oinstall

p) The installer will run through a series of checks to determine if both Oracle RAC nodes meet the minimum requirements for installing and configuring the Oracle Clusterware and Automatic Storage Management software.

Starting with Oracle Clusterware 11g release 2 (11.2), if any checks fail, the installer (OUI) will create shell script programs, called fixup scripts, to resolve many incomplete system configuration requirements. If OUI detects an incomplete task that is marked “fixable”, then you can easily fix the issue by generating the fixup script by clicking the [Fix & Check Again] button.

The fixup script is generated during installation. You will be prompted to run the script as root in a separate terminal session. When you run the script, it raises kernel values to required minimums, if necessary, and completes other operating system configuration tasks.

If all prerequisite checks pass (as was the case for my install), the OUI continues to the Summary screen
if you are installing RAC on VMWare and see error for “Physical Memory” and “Swap Szie” check “Ingnore All” and then click Next

q) you will be see this error:
“Device checks for ASM”
this is a bug you should use patch number 9974223, first choose “Ignore All” and countinue to istall.

******************************* step 20 **********************************

a)Install Cluster Health Management Software – (Optional)

b) Create ASM Disk Groups for Data and Fast Recovery Area in one node
in graphical mode run commands below

[root@oradbasm ~]# xhost +
[root@oradbasm ~]# su – grid
[root@oradbasm ~]# asmca

a) For creating DATA disk group, From the “Disk Groups” tab, click the “Create” button.
Disk Group Name: DATA
Redundancy : External
Select Member Disks: ORCL:DATA1 ,ORCL:DATA2, ORCL:DATA3, ORCL:DATA4
click [OK] button

b) for creating FRA(Flash Recovery Area) disk group, From the “Disk Groups” tab, click the “Create” button.
Disk Group Name: FRA
Redundancy : External
Select Member Disks: ORCL:FRA1 , ORCL:FRA2, ORCL:FRA3
click [OK] button