Oracle 11g RAC with ASM 安装在 RHEL5上(简版)

1、明确任务

准备一台RHEL5的PC机充当SAN设备,san(同时充当DNS和授时系统)

准备两台RHEL5的PC机充当RAC节点,r1和r2

将RAC安装在ASM磁盘上,包括OCR、VOTING、库

2、修改r1和r2的内核参数与shell限制

在r1和r2上分别进行

vim /etc/sysctl.conf
------------------------------------------
kernel.shmmax
= 4294967296
kernel.shmmni = 4096
kernel.shmall = 2097152
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 = 1048586

sysctl -p

vim
/etc/security/limits.conf
------------------------------------------
#Oracle configure shell parameters
oracle soft nofile
65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc
16384

grid soft nofile 65536
grid hard
nofile 65536
grid soft nproc 16384
grid hard nproc 16384

3、配置san、r1、r2的网络

在san、r1、r2上分别配置

vim/etc/hosts

127.0.0.1san localhost.localdomain
localhost
::1localhost6.localdomain6 localhost6

192.168.33.100san

192.168.33.101 r1
192.168.33.102 r2

192.168.33.201 r1-vip#不要配置在网卡上
192.168.33.202 r2-vip#不要配置在网卡上

10.0.0.1 r1-priv
10.0.0.2 r2-priv

4、在san上配置DNS

yum install bind bind-chroot caching-nameserver

cd /var/named/chroot/etc

cp -p named.caching-nameserver.conf named.conf
vim
/var/named/chroot/etc/named.conf

options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1;
};
directory "/var/named";
dump-file
"/var/named/data/cache_dump.db";
statistics-file
"/var/named/data/named_stats.txt";
memstatistics-file
"/var/named/data/named_mem_stats.txt";

allow-query { any; };
allow-query-cache { any; };
};
logging
{
channel default_debug {
file "data/named.run";
severity
dynamic;
};
};
view localhost_resolver {
match-clients { any;
};
match-destinations { any; };
recursion yes;
include
"/etc/named.zones";
};

cp -p named.rfc1912.zones named.zones

vim /var/named/chroot/etc/named.zones

// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver
package
//
// ISC BIND named zone configuration for zones recommended
by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See
/usr/share/doc/bind*/sample/ for example named configuration
files.
//
zone "." IN {
type
hint;
file "named.ca";
};

zone "localdomain" IN {
type
master;
file
"localdomain.zone";
allow-update {
none; };
};

zone "localhost" IN {
type
master;
file
"localhost.zone";
allow-update {
none; };
};

zone "0.0.127.in-addr.arpa" IN
{
type
master;
file
"named.local";
allow-update {
none; };
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa"
IN {
type
master;
file
"named.ip6.local";
allow-update {
none; };
};

zone "255.in-addr.arpa" IN {
type master;
file
"named.broadcast";
allow-update {
none; };
};

zone "0.in-addr.arpa" IN {
type
master;
file
"named.zero";
allow-update { none;
};
};

zone "ora11grac.com" IN {
type master;
file
"ora11grac.com.zone";
allow-update { none; };
};

zone "33.168.192.in-addr.arpa" IN {
type
master;
file "33.168.192.local";
allow-update { none; };
};

cd /var/named/chroot/var/named
cp -p named.zero ora11grac.com.zone
cp
-p named.local 33.168.192.local

vim /var/named/chroot/var/named/ora11grac.com.zone

$TTL 86400
@ IN SOA dns.ora11grac.com. root.ora11grac.com. (
42 ;
serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ;
minimum
@ IN NS dns.ora11grac.com.
r1 IN A 192.168.33.101
r2 IN A
192.168.33.102
r1-vip IN A 192.168.33.201
r2-vip IN A
192.168.33.202
scan IN A 192.168.33.195
scan IN A 192.168.33.196
scan
IN A 192.168.33.197

vim /var/named/chroot/var/named/33.168.192.local

$TTL 86400
@ IN SOA dns.ora11grac.com. root.ora11grac.com.
(
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ;
Expire
86400 ) ; Minimum
@ IN NS dns.ora11grac.com.
101 IN PTR
r1.ora11grac.com.
102 IN PTR r2.ora11grac.com.
201 IN PTR
r1-vip.ora11grac.com.
202 IN PTR r2-vip.ora11grac.com.
195 IN PTR
scan.ora11grac.com.
196 IN PTR scan.ora11grac.com.
197 IN PTR
scan.ora11grac.com.

service named restart

chkconfig named on

完成后在客户端测试

vim /etc/resolve.conf

search ora11grac.com

nameserver 192.168.33.100

然后ping scan.ora11grac.com,或者nslookup scan.ora11grac.com

5、添加用户和组在r1、r2

在r1、r2分别

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 dba,oper,asmdba oracle
useradd -u 502 -g oinstall -G dba,asmadmin,asmdba,asmoper grid

在r1、r2上修改配置文件

vim /home/grid/.bashrc

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/11.2.0/grid
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=+ASM1 #r2节点为 export ORACLE_SID=+ASM2
export ORACLE_TERM=vt100
export THREADS_FLAG=native
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export
PATH=$ORACLE_HOME/bin:$PATH
export LANG=en_US
alias
sqlplus=‘rlwrap sqlplus‘
alias lsnrctl=‘rlwrap lsnrctl‘
alias
asmcmd=‘rlwrap asmcmd‘

vim /home/oracle/.bashrc

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_OWNER=oracle
export ORACLE_SID=orcl1 #rac2节点为 export ORACLE_SID=orcl2
export ORACLE_TERM=vt100
export THREADS_FLAG=native
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export
PATH=$ORACLE_HOME/bin:$PATH
export EDITOR=vi
export
SQLPATH=/home/oracle
export LANG=en_US
alias
sqlplus=‘rlwrap sqlplus‘
alias lsnrctl=‘rlwrap lsnrctl‘
alias rman=‘rlwrap
rman‘
alias dgmgrl=‘rlwrap dgmgrl‘

6、创建目录在r1、r2

在r1、r2分别

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

7、配置grid、oracle用户下的双机互信(需要单步)

在r1上

su - grid

ssh-keygen -t rsa

ssh-keygen -t dsa

cd .ssh

cat *.pub > authorized_keys

在r2上

su - grid

ssh-keygen -t rsa

ssh-keygen -t dsa

cd .ssh

cat *.pub > authorized_keys

在r1上

scp authorized_keys [email protected]:/home/grid/.ssh/k1

在r2上

cat /home/grid/.ssh/k1 >> authorized_keys

scp authorized_keys [email protected]:/home/grid/.ssh/

在r1上

su - oracle

ssh-keygen -t rsa

ssh-keygen -t dsa

cd .ssh

cat *.pub > authorized_keys

在r2上

su - oracle

ssh-keygen -t rsa

ssh-keygen -t dsa

cd .ssh

cat *.pub > authorized_keys

在r1上

scp authorized_keys oracle@r2:/home/oracle/.ssh/k1

在r2上

cat /home/oracle/.ssh/k1 >> authorized_keys

scp authorized_keys oracle@r1:/home/oracle/.ssh/

分别在r1、r2上测试双机信任

ssh r1 date

ssh r2 date

ssh r1-priv date

ssh r2-priv date

8、配置NTP服务器在san上(不在san上做在其它机器上做也可以)

在san上

vim /etc/sysconfig/ntpd
# Drop root to id ‘ntp:ntp‘ by
default.
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"

# Set to ‘yes‘ to sync hw clock after successful
ntpdate
SYNC_HWCLOCK=no

# Additional options for ntpdate

vim /etc/ntp.conf
restrict default nomodify
restrict
127.0.0.1
server 127.127.1.0
fudge 127.127.1.0 stratum 8
driftfile
/var/lib/ntp/drift
broadcastdelay 0.008

启动ntpd服务

service ntpd restart

chkconfig ntpd on

在客户端r1、r2

ntpdate san

然后使用crontab -e

*/5 * * * * /usr/sbin/ntpdate san

建议拷贝配置文件到r1、r2,然后在r1、r2也启动ntpd,因为grid安装的时候会进行校验

9、配置集中存储san

在san上

yum install scsi-target-utils -y
vim /etc/tgt/targets.conf

<target lun1>
backing-store /dev/sdb1
backing-store /dev/sdc1
backing-store /dev/sdd1
backing-store /dev/sde1
backing-store /dev/sdf1
backing-store /dev/sdf2
backing-store /dev/sdf3
</target>

service tgtd start
tgtadm --lld iscsi -m target --op show
chkconfig
tgtd on

在r1和r2上

yum install iscsi-initiator-utils -y
service iscsid start
iscsiadm -m
discovery -t st -p san
service iscsi start
chkconfig iscsid
on
chkconfig iscsi on

10、配置udev绑定裸设备在r1、r2上

在r1、r2上

ll /dev/sd*

brw-r----- 1 root disk 8,0 Jan4 19:31 /dev/sda
brw-r----- 1
root disk 8,1 Jan4 11:31 /dev/sda1
brw-r----- 1 root disk
8,2 Jan4 19:31 /dev/sda2
brw-r----- 1 root disk 8, 16 Jan4 13:31 /dev/sdb
brw-r----- 1 root disk 8, 17 Jan4 16:30
/dev/sdb1
brw-r----- 1 root disk 8, 32 Jan4 13:31
/dev/sdc
brw-r----- 1 root disk 8, 33 Jan4 16:30
/dev/sdc1
brw-r----- 1 root disk 8, 48 Jan4 13:32
/dev/sdd
brw-r----- 1 root disk 8, 49 Jan4 16:30
/dev/sdd1
brw-r----- 1 root disk 8, 64 Jan4 13:32
/dev/sde
brw-r----- 1 root disk 8, 65 Jan4 16:30
/dev/sde1
brw-r----- 1 root disk 8, 80 Jan4 13:32
/dev/sdf
brw-r----- 1 root disk 8, 81 Jan4 16:29
/dev/sdf1
brw-r----- 1 root disk 8, 96 Jan4 13:33
/dev/sdg
brw-r----- 1 root disk 8, 97 Jan4 16:29
/dev/sdg1
brw-r----- 1 root disk 8, 98 Jan4 16:29 /dev/sdg2

vim /etc/udev/rules.d/60-raw.rules

ACTION=="add", KERNEL=="sdf1", RUN+="/bin/raw /dev/raw/raw1
%N"
ACTION=="add", KERNEL=="sdg1", RUN+="/bin/raw /dev/raw/raw2
%N"
ACTION=="add", KERNEL=="sdg2", RUN+="/bin/raw /dev/raw/raw3
%N"
KERNEL=="raw1", OWNER="grid", GROUP="asmadmin",
MODE="660"
KERNEL=="raw2", OWNER="grid", GROUP="asmadmin",
MODE="660"
KERNEL=="raw3", OWNER="grid", GROUP="asmadmin", MODE="660"

11、安装依赖包

yum install binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel
gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel
libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel -y

12、安装ASM的RPM包(务必注意版本和平台)

rpm -ivh oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm

13、配置ASM

在r1上

/etc/init.d/oracleasm configure

用户指定:grid

组指定:asmadmin

其余都是yes

建立oracleasm磁盘

/etc/init.d/oracleasm createdisk V1 /dev/sdb1

/etc/init.d/oracleasm createdisk V2 /dev/sdc1

/etc/init.d/oracleasm createdisk V3 /dev/sdd1

/etc/init.d/oracleasm createdisk V4 /dev/sde1

在r2上进行扫描

/etc/init.d/oracleasm scandisks

14、用grid用户安装grid校验

./runcluvfy.sh stage -pre crsinst -n r1,r2 -fixup -verbose

15、安装grid

在grid用户下

./runInstaller

在Instalaation Type选择

Install and Configure Grid Infrustructure for a Cluster

在Product Languages选择

Advanced Installation

在Grid Plug and Play Information填写

Cluster Name: r-cluster

SCAN Name: scan.ora11grac.com

SCAN Port: 1521

Configure GNS不勾选

在Cluster Node Information填写

r1.ora11grac.comr1-vip.ora11grac.com

r2.ora11grac.comr2-vip.ora11grac.com

这个vip不要使用ifconfig去添加

在Specify Network Interface Usage对应填写

eth0192.168.33.0Public

eth110.0.0.0Private

在Storage Option Information选择

Automatic Storage Management(ASM)

在Create ASM Disk Group

选择刚刚认出的raw1, raw2, raw3组成Disk Group Name为grid

在Specify ASM Password

填写用户口令

在Failure Isolation Support选择

Do not use Intelligent Platform Management(IPMI)

在Privileged Operating System Groups填写:

ASM Database Administrator (OSDBA) Group: asmdba

ASM Instance Administration Operator (OSOPER) Group: asmoper

ASM Instance Administrator (OSASM) Group:asmadmin

在Specify Installation Location中填写:

Oracle Base: /u01/app/oracle

Software Location: /u01/app/oracle/product/11.2.0/grid

在Create Inventory中填写:

Inventory Directory: /u01/app/oraInventory

oraInventory Group Name: oinstall

安装完成后

在r1运行

/u01/app/oraInventory/orainstRoot.sh

在r2运行

/u01/app/oraInventory/orainstRoot.sh

在r1运行

/u01/app/11.2.0/grid/root.sh

在r2运行

/u01/app/11.2.0/grid/root.sh

16、安装数据库

先要确保所有的重要服务都是ONLINE的

crs_stat -t

一般oc4j会不在线,那就

srvctl enable oc4j

srvctl start oc4j

olsnodes -n

出现r1,r2

这样就OK了

(gsd服务不在线不影响库软件的安装和库的建立)

用grid用户,开启asmca,创建一个ASM磁盘组+ASM

在r1切换到

su - oracle

./runInstaller

在Select Installation Option

选择Install database software only,只安装数据库引擎软件

在Node Selection

勾选r1,r2两个节点

在Select Database Edition选择

Enterprise Edition

在Specify Installation Location填写

Oracle Base: /u01/app/Oracle

Software Location: /u01/app/oracle/product/11.2.0/dbhome_1

执行完毕后运行,在r1、r2运行

/u01/app/oracle/product/11.2.0/db_1/root.sh

完成。

时间: 2024-11-05 14:50:09

Oracle 11g RAC with ASM 安装在 RHEL5上(简版)的相关文章

Oracle 10g RAC with ASM 安装在 RHEL5上(简版)

1.准备三个节点 一台做SAN设备 两台做ORACLE RAC节点,每个节点2个网卡 2.分配IP地址 saneth0 10.0.0.1 c1eth0 192.168.33.101 eth0:1 192.168.33.201 c2eth0 192.168.33.102eth0:1 192.168.33.202 给eth0加入虚拟IP使用下面的命令 ifconfig eth0:1 192.168.33.201 netmask 255.255.255.0ifconfig eth0:1 192.168

【Oracle 集群】Oracle 11G RAC教程之集群安装(七)

Oracle 11G RAC集群安装(七) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总.然后形成体系的总结,一则进行回顾复习,另则便于查询使用.本图文文档亦源于此.阅读Oracle RAC安装与使用教程前,笔者先对这篇文章整体构思和形成进行梳理.由于阅读者知识储备层次不同,我将从Oracle RAC安装前的准备与规划开始进行整体介绍安装部署Oracle RAC.始于唐博士指导,对数据库集群进行配

Oracle 11g RAC到单实例ASM的物理Standby搭建

一.DG环境配置 此次搭建Standby的主库为:" RedHat 6.5+11G+RAC+ASM安装与配置(三节点)",11g单实例ASM安装使用ASMLib的方式,不在使用UDEV方式,磁盘为本机磁盘,非远程挂载的磁盘.本次搭建包含了11g单实例ASM的详细安装过程. 1. 基本环境 主库: 实例名:racdb1,racdb2,racdb3        DB_NAME:racdb              DB_UNIQUE_NAME:racdb 备库: 实例名:racdg  

安装Oracle 11g RAC R2 之Linux DNS 配置

Oracle 11g RAC 集群中引入了SCAN(Single Client Access Name)的概念,也就是指集群的单客户端访问名称.SCAN 这个特性为客户端提供了单一的主机名,用于访问集群中运行的 Oracle 数据库.如果您在集群中添加或删除节点,使用 SCAN 的客户端无需更改自己的 TNS 配置.无论集群包含哪些节点,SCAN 资源及其关联的 IP 地址提供了一个稳定的名称供客户端进行连接使用.在Oracle 11g grid 安装时即要求为该特性配置DNS解析方式或GNS解

oracle 11g RAC安装节点二执行结果错误CRS-5005: IP Address: 192.168.1.24 is already in use in the network

[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oins

oracle 11g rac dbca建库时提示创建监听

Oracle 11g rac dbca建库时提示创建监听 在安装oracle 11g rac时,使用dbca建库的过程中提示需要创建监听: Default Listener "LISTENER" is not configured in Grid Infrantructure home.Use NetCA to configure Default Listener and return DBCA 解决步骤如下 因为oracle 11g rac在安装过程中会自动创建监听,无需手动创建,首

Oracle 11g rac 生产环境部署详录

作者:田逸([email protected]) 基本规划 ◎设备选型 1.服务器:Dell R620 两台.cpu 8 core,内存64G,600G 15000转sas硬盘,双电源,hba卡一块,连接存储线缆一根(连接hba卡和共享存储). 2.存储:dell MD3200 一台.双控制器,12块600G 15000转sas硬盘.为追求最高可用性,使用的raid级别是raid10. 3.交换机:华为3com两台,型号为h3c S5048E.注意:网络端口最好是全千兆. 4.网线:2-3米机制

oracle 11g RAC 的一些基本概念(四)

RAC 在Grid Infrastructure安装完以后,我们把注意力转移到集群上的Oracle软件的安装上来.我们看到,Grid Infrasctructure提供了运行RAC的框架,包括集群通讯链接.节点分离.节点成员关系等服务.ASM是Oracle存储数据库的首选方式.RAC利用这些概念并扩展了需要的基本服务. 安装选项 成功安装了Grid Infrastructure/Clusterware以后,Oracle Universal Installer检测到集群环境的建立,然后提供安装整个

oracle 11g RAC 的一些基本概念(三)

Grid Infrastructure共享组件 Grid Infrastructure使用两种类型的共享设备来管理集群资源和节点:OCR(Oracle Cluster Registry)和表决磁盘.Oracle 11.2引入一个新的文件,称作Oracle Local Registry(OLR),它只允许存放在本地. OCR和OLR OCR为所有节点所共享,包含了集群资源的所有信息和 Grid Infrastructure需要的操作许可.为了实现共享,OCR需要存放在裸设备.共享块设备.类似OCF