Oracle RAC部署过程

lsb_release -a
vmware-vdiskmanager.exe -c -s 20000Mb -a lsilogic -t 2 D:\Oracle_RAC\ocr.vmdk
vmware-vdiskmanager.exe -c -s 20000Mb -a lsilogic -t 2 D:\Oracle_RAC\ocr2.vmdk
vmware-vdiskmanager.exe -c -s 20000Mb -a lsilogic -t 2 D:\Oracle_RAC\votingdisk.vmdk
vmware-vdiskmanager.exe -c -s 30000Mb -a lsilogic -t 2 D:\Oracle_RAC\data.vmdk
vmware-vdiskmanager.exe -c -s 20000Mb -a lsilogic -t 2 D:\Oracle_RAC\backup.vmdk
RAC1

配置虚拟机RAC1 RAC2目录下的vmx虚拟机配置文件,在行最后添加如下:
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1.sharedBus = "virtual"
scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.filename = "D:\Oracle_RAC\ocr.vmdk"
scsi1:1.deviceType = "plainDisk"
scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.filename = "D:\Oracle_RAC\votingdisk.vmdk"
scsi1:2.deviceType = "plainDisk"
scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.filename = "D:\Oracle_RAC\data.vmdk"
scsi1:3.deviceType = "plainDisk"
scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.filename = "D:\Oracle_RAC\backup.vmdk"
scsi1:4.deviceType = "plainDisk"
scsi1:5.present = "TRUE"
scsi1:5.mode = "independent-persistent"
scsi1:5.filename = "D:\Oracle_RAC\ocr2.vmdk"
scsi1:5.deviceType = "plainDisk"
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"

关闭selinux
setenforce 0
[[email protected] ~]# vi /etc/selinux/config
SELINUX=disabled
关闭防火墙
service iptables stop
chkconfig iptables off
卸载NTP服务
[[email protected] ~]# rpm -qa |grep ntp
[[email protected] ~]# rpm -e --nodeps ntp-4.2.6p5-1.el6.centos.x86_64
[[email protected] ~]# rpm -e --nodeps ntpdate-4.2.6p5-1.el6.centos.x86_64
[[email protected] ~]#mv /etc/ntp.conf /etc/ntp.conf.bak

hostname rac1
hostname rac2
RAC1
eth0 192.168.100.103
eht1 10.10.10.100
RAC2
eth0 192.168.100.104
eth1 10.10.10.101
vi /etc/sysconfig/network

vi /etc/hosts
192.168.100.103 rac1
192.168.100.104 rac2
192.168.100.105 rac1-vip
192.168.100.108 rac2-vip
10.10.10.100 rac1-priv
10.10.10.101 rac2-priv
192.168.100.88 scan-ip

创建相关用户:
groupadd -g 1300 dba
groupadd -g 1301 oper
groupadd -g 1000 oinstall
groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper
useradd -m -u 1100 -g oinstall -G asmadmin,asmdba,asmoper -s /bin/bash grid
useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -s /bin/bash oracle
设置相关账户密码:
passwd oracle passwd grid
RAC1 RAC2相互配置ssh免秘钥登陆
在用户root oracle grid执行以下2行命令:
RAC1、RAC2:
ssh-keygen -t rsa
ssh-keygen -t dsa
切换用户配置以下ssh命令:
su - oracle
su - grid
RAC1
[[email protected] ~]$
ssh rac1 cat ~/.ssh/id_rsa.pub >> authorized_keys
ssh rac2 cat ~/.ssh/id_rsa.pub >> authorized_keys
ssh rac1 cat ~/.ssh/id_dsa.pub >> authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> authorized_keys
[[email protected] .ssh]$ scp authorized_keys rac2:~/.ssh/
[[email protected] .ssh]$ chmod 600 authorized_keys
RAC2:
[[email protected] ~]$
ssh rac2 cat ~/.ssh/id_rsa.pub >> authorized_keys
ssh rac1 cat ~/.ssh/id_rsa.pub >> authorized_keys
ssh rac2 cat ~/.ssh/id_dsa.pub >> authorized_keys
ssh rac1 cat ~/.ssh/id_dsa.pub >> authorized_keys
[[email protected] .ssh]$ scp authorized_keys rac1:~/.ssh/
[[email protected] .ssh]$ chmod 600 authorized_keys
ssh rac1 date
ssh rac2 date
ssh rac1-priv date
ssh rac2-priv date

配置目录
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle
chown -R grid:oinstall /u01
chown grid:oinstall /u01/app/11.2.0/grid
chown grid:oinstall /u01/app/grid
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/

设置内核文件:
vi /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4398046511104
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
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
参考值:
kernel.shmmax =1054472192 (参考值)
sysctl -p 立即生效

配置系统文件
vi /etc/security/limits.conf
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

配置grid和oracle用户环境变量
su - oracle
ORACLE环境变量
vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=orcl1 # RAC1
export ORACLE_SID=orcl2 # RAC2
export ORACLE_UNQNAME=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022
使配置文件生效 source .bash_profile
GRID环境变量
su - grid
vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SID=+ASM1 # RAC1

export ORACLE_SID=+ASM2 # RAC2 配置一个即可

export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
umask 022
使配置文件生效 source .bash_profile
配置login
[[email protected] ~]# vi /etc/pam.d/login
session required pam_limits.so

配置裸盘:
查看未格式化的磁盘
fdisk -l
ls /dev/sd
fdisk格式化命令:
fdisk /dev/sdb
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
最后 w 命令保存更改
Command (m for help): w
依次执行:
fdisk /dev/sdb
fdisk /dev/sdd
fdisk /dev/sdc
fdisk /dev/sdf
fdisk /dev/sde
vi /etc/udev/rules.d/60-raw.rules
ACTION=="add",KERNEL=="/dev/sdb1",RUN+=‘/bin/raw /dev/raw/raw1 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="17",RUN+="/bin/raw /dev/raw/raw1 %M %m"
ACTION=="add",KERNEL=="/dev/sdc1",RUN+=‘/bin/raw /dev/raw/raw2 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="33",RUN+="/bin/raw /dev/raw/raw2 %M %m"
ACTION=="add",KERNEL=="/dev/sdd1",RUN+=‘/bin/raw /dev/raw/raw3 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="49",RUN+="/bin/raw /dev/raw/raw3 %M %m"
ACTION=="add",KERNEL=="/dev/sde1",RUN+=‘/bin/raw /dev/raw/raw4 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="65",RUN+="/bin/raw /dev/raw/raw4 %M %m"
ACTION=="add",KERNEL=="/dev/sdf1",RUN+=‘/bin/raw /dev/raw/raw5 %N"
ACTION=="add",ENV{MAJOR}=="8",ENV{MINOR}=="81",RUN+="/bin/raw /dev/raw/raw5 %M %m"
ACTION=="add",KERNEL=="raw[1-5]",OWNER="grid",GROUP="asmadmin",MODE="660"
在RAC1和RAC2执行下同步命令:partprobe
执行这个命令查看下:ll /dev/raw/raw

查看裸盘信息:
[[email protected] ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 1000M 0 part /boot
├─sda2 8:2 0 3.9G 0 part [SWAP]
└─sda3 8:3 0 35.1G 0 part /
sdb 8:16 0 19.5G 0 disk
└─sdb1 8:17 0 19.5G 0 part
sdc 8:32 0 19.5G 0 disk
└─sdc1 8:33 0 19.5G 0 part
sdd 8:48 0 29.3G 0 disk
└─sdd1 8:49 0 29.3G 0 part
sde 8:64 0 19.5G 0 disk
└─sde1 8:65 0 19.5G 0 part
sdf 8:80 0 19.5G 0 disk
└─sdf1 8:81 0 19.5G 0 part
sr0 11:0 1 4.2G 0 rom
挂载光驱
mount /dev/sr0 /media/CentOS_6.5_Final (参考命令:mount /dev/cdrom /mnt/cdrom/ )
vi /etc/yum.repos.d/dvd.repo
[dvd]
name=dvd
baseurl=file:///media/CentOS_6.5_Final
gpgcheck=0
enabled=1
:wq!
安装依赖包:
[[email protected] ~]# yum clean all
[[email protected] ~]# yum makecache
[[email protected] ~]# yum install gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel make sysstat
yum install binutils-2
compat-libcap1-1 compat-libstdc gcc-4 gcc-c++-4 glibc-2 glibc-devel-2 libgcc-4 libstdc++-4 libstdc++-devel-4 libaio-0 libaio-devel-0 make-3 sysstat-9 -y
mv /etc/yum.repos.d/CentOS-Base.repo /root
mv /etc/yum.repos.d/CentOS-Debuginfo.repo /root
mv /etc/yum.repos.d/CentOS-Media.repo /root
mv /etc/yum.repos.d/CentOS-Vault.repo /root
cp /root/CentOS-Base.repo /etc/yum.repos.d
cp /root/CentOS-Debuginfo.rep /etc/yum.repos.d
cp /root/CentOS-Media.repo /etc/yum.repos.d
cp /root/CentOS-Vault.repo /etc/yum.repos.d
yum install -y glibc-devel-2.12-1.209.el6_9.2.i686
yum install -y libstdc++-4.4.7-18.el6.i686
yum install -y glibc.i686 glibc.x86_64
yum install -y elfutils-libelf-devel.i686
yum install -y elfutils-libelf

进grid下面安装
cvuqdisk包
xhost + #使所有用户都能访问图形桌面,这步需要在图形界面操作
date -s 18:00:00
/u01/app/oraInventory/orainstRoot.sh
/u01/app/11.2.0/grid/root.sh

/u01/app/11.2.0/grid/crs/install/crsconfig_params
[[email protected] grid]# /u01/app/11.2.0/grid/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)

Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)

Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)

y Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
2017-08-03 18:31:49: Parsing the host name
2017-08-03 18:31:49: Checking for super user privileges
2017-08-03 18:31:49: User has super user privileges
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
CRS is already configured on this node for crshome=0
Cannot configure two CRS instances on the same cluster.
Please deconfigure before proceeding with the configuration of new home.
[[email protected] grid]#
卸载命令
$GRID_HOME/crs/install/roothas.pl -delete -force -verbose
/u01/app/11.2.0/grid/crs/install/rootcrs.pl -delete -force -verbose
Existing OCR configuration found, aborting the configuration. Rerun configuration setup after deinstall at /u01/app/11.2.0/grid/crs/install/crsconfig_lib.pm line 10302.
确定RAC是否OK
su - grid
crsctl status resource -t
修改网卡规则
vi /etc/udev/rules.d/70-persistent-net.rules
三驾马车不是DG GG RAC
切换scan-ip命令:
srvctl relocate scan_listener -i 1 -n rac2

原文地址:http://blog.51cto.com/735526/2112037

时间: 2024-11-10 07:28:35

Oracle RAC部署过程的相关文章

Oracle RAC安装过程中碰到的“坑”和关键点(二)

(1) 依赖包的安装 Linux下安装Oracle,除了系统配置参数,我觉得依赖包的安装是另一个比较琐碎的操作. 本次安装碰到了几个包的问题: (a) rpm -Uvh gcc-4*提示: 02. error: Failed dependencies: 03.    cloog-ppl >= 0.15 is needed by gcc-4.4.7-4.el6.x86_64 04.    cpp = 4.4.7-4.el6 is needed by gcc-4.4.7-4.el6.x86_64 不

oracle rac 巡检过程详解

一 RAC环境 RAC架构,2节点信息 节点1 SQL> show parameter instance NAME                                 TYPE        VALUE ------------------------------------ ----------- ----------------------------------------------- active_instance_count                    inte

Oracle RAC安装过程中碰到的“坑”和关键点(一)

在物理机上使用虚机搭建RAC环境时碰到了很多"坑"和关键点,这里慢慢一一回味总结下. 物理机:Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz,8G内存 虚拟机软件:VMware ServerVersion 2.0.2 数据库软件:Oracle 11.2.0.1.Grid 虚机操作系统:Oracle Linux 6.2 虚机安装规划:本地硬盘20G,内存2G,共享磁盘共有4块:2块VOTE,各1.2G,2块数据盘,各5G (1) 虚拟机本地磁盘和共享磁盘

ORACLE RAC部署实录(二):Oracle Grid Infrastructure

[[email protected] ~]# groupadd -g 1300 dba [[email protected] ~]# groupadd -g 1301 oper [[email protected] ~]# groupadd -g 1000 oinstall  [[email protected] ~]# groupadd -g 1200 asmadmin [[email protected] ~]# groupadd -g 1201 asmdba  [[email protec

Oracle RAC部署环境确认

提供通用软件售前技术咨询,售后技术维保,软件故障排查,解决方案,软件技术支持兼职等业务,欢迎来询. 电话&微信 :18046508828 QQ : 1710484168 软件技术支持范围 数据库,系统,双机.集群,虚拟化,存储,备份,杀毒等 数据库:Oracle,Mysql,Sql server,sybase...系统:Window,Linux,Aix...双机.集群:Rose,Lifekeeper,NEC,clusterware,联鼎LanderVault...杀毒:瑞星,卡巴,Symante

部署Physical Dataguard 与 双节点Oracle RAC环境

关于oracle rac 部署请访问这里 http://worms.blog.51cto.com/969144/1416975 系统信息: Primary端 RAC  Primary RACDG1(主机) RACDG2(主机) 备注 Public IP 172.20.10. 11 172.20.10. 12 Virtual IP 10.0.0.11 10.0.0.12 Instance racdg1 racdg2 DB name RACDG DATA file +DATA2/racdg/data

Oracle RAC安装部署文档

1.    部署环境步骤 1.1 软件环境 操作系统:CentOS release 6.5(推荐使用5.*的系统)192.168.1.151    racnode1 192.168.1.152    racnode2 oracle安装包:p10404530_112030_Linux-x86-64_1of7.zipp10404530_112030_Linux-x86-64_2of7.zipp10404530_112030_Linux-x86-64_3of7.zipkmod-oracleasm-2.

Oracle RAC集群安装之:Grid软件安装过程蓝屏

前几天在安装一套RAC服务器的过程中,遇到了蓝屏事件,折腾了蛮久(在排查是否存在硬件问题上花费了相当多一部分时间),整个过程大概说明如下: 1.两台华为的PC SERVER,操作系统为WIN SERVER 2008 R2,装11.2.0.3的Oracle集群. 2.第一次安装到准备在第二节点进行GRID安装的步骤时,安装操作所在的节点1蓝屏自动重启了. 3.重启节点1每次都会在出现登陆界面前一刻发生蓝屏. 4.集成部门的同事查看两台服务器的面板,发现蓝屏的服务器在面板上有些指示灯不亮,怀疑是服务

【Oracle RAC】Linux系统Oracle12c RAC安装配置详细记录过程V2.0(图文并茂)

[Oracle RAC]Linux系统Oracle12c RAC安装配置详细过程V2.0(图文并茂) 2 Oracle12c RAC数据库安装准备工作2.1 安装环境介绍2.2 数据库安装软件下载3 Oracle12c RAC数据库安装环境配置3.1 安装主机或虚拟机3.2 安装操作系统3.3 hosts文件配置3.4 添加组与用户3.5 添加文件系统3.6 修改操作系统参数3.7 禁止NTP3.8 配置grid和oracle用户的环境变量3.9 配置SSH信任关系3.10 调整页面交换空间3.