ORACLE-RAC-11G-R2_INSTALL

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORACLE-RAC-11G-R2_INSTALL相关的知识,希望对你有一定的参考价值。

ORACLE 11.2.0.3 RAC INSTALL
                                                                       2013-06-09 __Yoon
挂载镜像:
mkdir /media/disk
mount /dev/cdrom /media/disk

 

安装oracle-linux依赖的所有包:
vi /etc/yum.repos.d/public-yum-el5.repo
[oel5]
name = Enterprise Linux 5.7 DVD
baseurl=file:///media/disk/Server/
gpgcheck=0
enabled=1

yum install oracle-validated --执行并安装依赖的包

修改hosts,配置域名:
vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1 rac1 localhost.localdomain localhost
#::1 localhost6.localdomain6 localhost6
127.0.0.1 localhost
192.168.228.161 rac1
192.168.228.168 rac1-vip
1.1.1.161 rac1-priv
192.168.228.162 rac2
192.168.228.169 rac2-vip
1.1.1.162 rac2-priv
192.168.228.170 rac-scan

 

添加组和用户:
groupadd -g 1000 oinstall
groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper
groupadd -g 1300 dba
groupadd -g 1301 oper
useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash grid
useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash oracle

 

创建oralce、grid 密码:
id oracle
id grid
passwd oracle
passwd grid

 

创建安装目录:
mkdir -p /u01/app/grid/11.2.0
chown -R grid:oinstall /u01
mkdir -p /u01/app/oracle/11.2.0/db_1
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01

 配置服务器时间同步:(10g需要配置,在11gR2中不用ntp配置)
rac1:
vi /etc/ntp.conf
server 127.127.1.0
fudge 127.127.1.0 stratum 11
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
rac2:
vi /etc/ntp.conf
server 192.168.228.161 prefer --192.168.228.161为主节点的IP地址
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
/etc/init.d/ntpd restart --重启

 

配置SSH: (在10g需要配置ssh通信,在11g R2新特性 无需配置SSH)
在rac1、rac2:
su - oracle
mkdir ~/.ssh
ssh-keygen -t rsa
ssh-keygen -t dsa
在rac1:
cat ~/.ssh/id_rsa.pub >> ./.ssh/authorized_keys
cat ~/.ssh/id_dsa.pub >> ./.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys
在rac1:
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date
在rac2:
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date

 

时间同步,配置ctss:  (在11g r2中不需要配置)
在rac1、rac2:
/sbin/service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.original
chkconfig ntpd --list
rm /var/run/ntpd.pid
安装完后要确认ctssd处于活动状态,用grid用户输入:
$ crsctl check ctss

在grid下配置.bash_profile:
rac1:
export ORACLE_SID=+ASM1
#export ORACLE_SID=+ASM2
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/grid/11.2.0
export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin/:.
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp
umask 022
rac2:
#export ORACLE_SID=+ASM1
export ORACLE_SID=+ASM2
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/grid/11.2.0
export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin/:.
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp
umask 022

 

在oracle下配置.bash_profile:
rac1和rac2: 注意SID
ORACLE_SID=yoon1; export ORACLE_SID
#ORACLE_SID=yoon2; export ORACLE_SID
ORACLE_UNQNAME=yoon; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/11.2.0/db_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="YYYY:MM:DD HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=american_america.ZHS16GBK; export NLS_LANG
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:$ORA_CRS_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
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
# ---------------------------------------------------
# UMASK
# ---------------------------------------------------
# Set the default file mode creation mask
# (umask) to 022 to ensure that the user performing
# the Oracle software installation creates files
# with 644 permissions.
# ---------------------------------------------------
umask 022

 

 

关闭防火墙:
Service iptables status
Service iptables stop
chkconfig iptables off
chkconfig iptables --list

安装ASMlib:
oracleasm-2.6.18-274.0.0.0.1.el5-2.0.5-1.el5.x86_64.rpm
oracleasm-2.6.18-274.el5-2.0.5-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm

 

安装配置oracleasm

/etc/init.d/oracleasm configure
/etc/init.d/oracleasm createdisk DATA /dev/mapper/Mpath2p1
/etc/init.d/oracleasm listdisks
/etc/init.d/oracleasm scandisks

 

在grid用户下:

执行./ runInstaller

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

在oracle下执行./ runInstaller,安装数据库软件

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

 

 

在grid用户下运行asmca创建ASM磁盘组:

su - grid

[[email protected] ~]$asmca

技术分享

技术分享

技术分享

在oracle用户下创建数据库:

su - oracle

执行dbca

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享

OK

 

--------------------------------------------------------------------------------------------------

Maclean Liu 所创脚本:
####udev 创建裸设备脚本#######
for i in b c d e f g h i j k ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id -g -u -s %p\", RESULT==\"`scsi_id -g -u -s /block/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"oracle\", GROUP=\"oinstall\", MODE=\"0660\""
done
#############################

 

udev方式创建裸设备:
vi /etc/udev/rules.d/60-raw.rules
ACTION=="add",KERNEL=="sdb1",RUN+="/bin/raw/dev/raw/raw1 %N"
ACTION=="add",KERNEL=="sdb2",RUN+="/bin/raw/dev/raw/raw2 %N"
ACTION=="add",KERNEL=="sdb3",RUN+="/bin/raw/dev/raw/raw3 %N"
ACTION=="add",KERNEL=="raw*",OWNER=="oracle",GROUP=="oinstall", MODE=="0660"
在root下执行:
start_udev

 

创建完oracleasm组后,无法删除:
service oracleasm stop
service oracleasm deletedisk /dev/mapper/mpath2p1
service oracleasm start
/etc/init.d/oracleasm scandisks
/etc/init.d/oracleasm listdisks

 

ASM磁盘无法识别几种现象:

1) gi家目录或者其子目录权限错误

2)asm磁盘的权限错误

3)asm实例未启动或者asm磁盘组没有mount上

4)asm磁盘组资源没有在线

5)oracle用户的权限错误

6)oracle($ORACLE_HOME/bin)可执行文件的权限错误
  OK,那我就按照上面的分析结果进行逐一排查:

1) gi家目录或者其子目录权限错误
[[email protected] ~]# ls -ld /u01/app/11.2.0/grid/
drwxr-x--- 66 root oinstall 4096 Apr 19 01:36 /u02/app/11.2.0/grid/
我先简单查看了GI的家目录权限,这是正常的。这里想要提醒大家,有些DBA有意无意中看到这样的目录权限,发现所属主是root,以为出了问题,理所应当地通过命令去更改,如果只更改该目录权限问题也不大,回退方法很简单,但一旦加上-R参数递归方式把子目录、子文件的权限一并更改,那故障就发生了。所以,大家在操作的时候不要盲目去做没有把握的事情,掌握每个操作后面的原理以及其带来的后果,以至于充分准备好回退方法.
2) asm磁盘的权限错误
[[email protected] ~]# ls -l /dev/oracleasm/disks/
total 0
brw-rw---- 1 grid asmadmin 8, 17 Apr 19 01:22 ASMDISK1
brw-rw---- 1 grid asmadmin 8, 33 Apr 19 01:22 ASMDISK2
如果发现权限不对,通过如下命令修改:
[[email protected] ~]# oracleasm configure -I
或者
[[email protected] ~]# /etc/init.d/oracleasm configure
修改之后查看:
[[email protected] ~]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=grid
ORACLEASM_GID=asmadmin
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
3) asm实例未启动或者asm磁盘组没有mount上
4) asm磁盘组资源没有在线:
[[email protected] ~]$ crsctl stat res –t
---------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
---------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE rac1
ora.FLASH.dg
ONLINE ONLINE rac1
ora.GRID.dg
ONLINE ONLINE rac1
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ora.asm
ONLINE ONLINE rac1 Started
ora.ons
OFFLINE OFFLINE rac1
---------------------------------------------------------------------
Cluster Resources
---------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE rac1
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE rac1
5) oracle用户的权限错误
[[email protected] ~]# id oracle
uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1300(dba),1301(oper),1201(asmdba)
oracle用户需要加入到asmdba组,如果发现没有加入,进行如下操作:
[[email protected] ~]# gpasswd -a oracle asmdba
Adding user oracle to group asmdba
6) oracle($ORACLE_HOME/bin)可执行文件的权限错误
[[email protected] ~]# su - oracle
[[email protected] ~]$ cd $ORACLE_HOME/bin
[[email protected] bin]$ ls -l oracle
-rwsr-s--x 1 oracle oinstall 232399473 Apr 19 07:04 oracle
oracle可执行文件的权限不正确:
[[email protected] ~]# cd /u01/app/oracle/product/11.2.0/dbhome_1/bin/
[[email protected] bin]# chown oracle.asmadmin oracle
[[email protected] bin]# ls -l oracle
-rwxr-x--x 1 oracle asmadmin 232399473 Apr 19 07:04 oracle
[[email protected] bin]# chmod +s oracle
[[email protected] bin]# ls -l oracle
-rwsr-s--x 1 oracle asmadmin 232399473 Apr 19 07:04 oracle

以上是关于ORACLE-RAC-11G-R2_INSTALL的主要内容,如果未能解决你的问题,请参考以下文章

oracle11g-R2静默安装报错[INS-32013]解决方案

windows_db2_install

OpenFlow_tutorial_2_Install_Required_Software

debuginfo-install glibc-2.17-157.el7.x86_64

influxdb-1.7.2.x86_64安装 install influxdb-1.7.2.x86_64 on RedHat & CentOS

silent install oracle 11.2.0.1 x86_64 for linux