文档章节

Linux redhat5.5安装Oracle 11g RAC + ASM + RAW 准备工作

楚云泽
 楚云泽
发布于 2016/02/27 20:35
字数 1366
阅读 505
收藏 8

提示
linux 磁盘最好是用lvm的方式管理
内存 1.5G以上
交换空间 3G以上
/tmp 目录2GB以上
安装Grid Infrastracture所需空间:8GB
安装Oracle Database所需空间:4GB
注:本文只讲解安装前的配置,具体的图形化安装教程网上很多,如果linux未安装图形界面,可以使用xmanager安装

查看内存及Swap大小的命令如下。
[root@rac1 ~]# grep MemTotal /proc/meminfo
[root@rac1 ~]# grep SwapTotal /proc/meminfo

创建共享磁盘
D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 5
00Mb -a lsilogic -t 2 "G:\Virtual Machines\Share Disks"\sharedisk01.vmdk
D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 5
00Mb -a lsilogic -t 2 "G:\Virtual Machines\Share Disks"\sharedisk02.vmdk
D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 4
Gb -a lsilogic -t 2 "G:\Virtual Machines\Share Disks"\sharedisk03.vmdk
D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 4
Gb -a lsilogic -t 2 "G:\Virtual Machines\Share Disks"\sharedisk04.vmdk

附加共享磁盘到虚拟机
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
scsi1.present = "TRUE"
scsi1.sharedBus = "virtual"
scsi1.virtualDev = "lsilogic"
scsi1:1.deviceType = "disk"
scsi1:1.fileName = "G:\Virtual Machines\Share Disks\sharedisk01.vmdk"
scsi1:1.mode = "independent-persistent"
scsi1:1.present = "TRUE"
scsi1:1.redo = ""
scsi1:2.deviceType = "disk"
scsi1:2.fileName = "G:\Virtual Machines\Share Disks\sharedisk02.vmdk"
scsi1:2.mode = "independent-persistent"
scsi1:2.present = "TRUE"
scsi1:2.redo = ""
scsi1:3.deviceType = "disk"
scsi1:3.fileName = "G:\Virtual Machines\Share Disks\sharedisk03.vmdk"
scsi1:3.mode = "independent-persistent"
scsi1:3.present = "TRUE"
scsi1:3.redo = ""
scsi1:4.deviceType = "disk"
scsi1:4.fileName = "G:\Virtual Machines\Share Disks\sharedisk04.vmdk"
scsi1:4.mode = "independent-persistent"
scsi1:4.present = "TRUE"
scsi1:4.redo = ""

给附加磁盘建立分区表 (n,p,1,回车,回车,w)
[root@rac1 ~]# fdisk /dev/sdb
[root@rac1 ~]# fdisk /dev/sdc
[root@rac1 ~]# fdisk /dev/sdd
[root@rac1 ~]# fdisk /dev/sde

格式化新建分区
[root@rac1 ~]# mkfs -t ext3 /dev/sdb1
[root@rac1 ~]# mkfs -t ext3 /dev/sdc1
[root@rac1 ~]# mkfs -t ext3 /dev/sdd1
[root@rac1 ~]# mkfs -t ext3 /dev/sde1

在每一个节点上添加安装Oracle Grid的用户、组和家目录,并设置权限。
[root@rac1 ~]# groupadd oinstall
[root@rac1 ~]# groupadd asmadmin
[root@rac1 ~]# groupadd asmdba
[root@rac1 ~]# groupadd asmoper
[root@rac1 ~]# groupadd dba
[root@rac1 ~]# groupadd oper
[root@rac1 ~]# useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid
[root@rac1 ~]# useradd -g oinstall -G dba,asmdba,oper oracle
[root@rac1 ~]# mkdir -p /u01/app/11.2.0/grid
[root@rac1 ~]# mkdir -p /u01/app/grid
[root@rac1 ~]# chown -R grid:oinstall /u01/app
[root@rac1 ~]# mkdir /u01/app/oracle
[root@rac1 ~]# chown oracle:oinstall /u01/app/oracle
[root@rac1 ~]# chmod -R 775 /u01/app
[root@rac1 ~]# passwd grid
[root@rac1 ~]# passwd oracle

设置环境变量
[grid@rac1 ~]$ vi ~/.bash_profile
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid
export ORACLE_SID=+ASM1 (rac2上为+ASM2)
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
[grid@rac1 ~]$ source ~/.bash_profile

[oracle@rac1 ~]$ vi ~/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export ORACLE_SID=racdb1 (rac2上为racdb2)
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
[oracle@rac2 ~]$ source ~/.bash_profile

修改/etc/sysctl.conf的内容
[root@rac1 ~]# vi /etc/sysctl.conf
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
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 = 1048576
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 536870912
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128

[root@rac1 ~]# sysctl -p

修改/etc/hosts的内容
[root@rac1 ~]# vi /etc/hosts
192.168.244.131 rac1
192.168.244.132 rac2
192.168.244.231 rac1-vip
192.168.244.232 rac2-vip
192.168.93.121 rac1-priv
192.168.93.122 rac2-priv
192.168.244.31 rac-scan
192.168.244.32 rac-scan
192.168.244.33 rac-scan

使用yum源安装依赖包
[root@rac1 ~]# yum -y install binutils-*
[root@rac1 ~]# yum -y install compat-lib*
[root@rac1 ~]# yum -y install gcc-*
[root@rac1 ~]# yum -y install glibc-*
[root@rac1 ~]# yum -y install libgcc-*
[root@rac1 ~]# yum -y install libstdc++*
[root@rac1 ~]# yum -y install libaio-*
[root@rac1 ~]# yum -y install make-*
[root@rac1 ~]# yum -y install sysstat-*
[root@rac1 ~]# yum -y install unixODBC*
[root@rac1 ~]# yum -y install elfutils-*

关闭NTPOracle(建议使用Oracle Cluster Time Synchronization Service,因此关闭删除NTP)
[root@rac1 ~]# /sbin/service ntpd stop
[root@rac1 ~]# chkconfig ntpd off
[root@rac1 ~]# rm /etc/ntp.conf
[root@rac1 ~]# rm /var/run/ntpd.pid

设置oracle使用的文件数权限
[root@rac1 ~]# vi /etc/security/limits.conf
oracle           soft      nproc           2047
oracle           hard     nproc           16384
oracle           soft      nofile           1024
oracle           hard     nofile           65536
grid              hard     nproc           16384
grid              hard     nofile            65536

修改安全限制
[root@rac1 ~]# vi /etc/pam.d/login
session    required     /lib/security/pam_limits.so

配置裸设备
[root@rac1 ~]# 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"
KERNEL=="raw[1-4]", OWNER="oracle", GROUP="oinstall", MODE="640"
[root@rac1 ~]# start_udev

配置SSH互信(grid和oracle都要配置)
[root@rac1 ~]# su - grid
[grid@rac1~]$ mkdir ~/.ssh
[grid@rac1~]$ chmod 700 ~/.ssh
[grid@rac1~]$ ssh-keygen -t rsa
[grid@rac1~]$ ssh-keygen -t dsa

[grid@rac2~]$ mkdir ~/.ssh
[grid@rac2~]$ chmod 700 ~/.ssh
[grid@rac2~]$ ssh-keygen -t rsa
[grid@rac2~]$ ssh-keygen -t dsa

[grid@rac1~]$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[grid@rac1~]$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

[grid@rac1~]$ ssh rac2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
[grid@rac1~]$ ssh rac2 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
[grid@rac1~]$ scp ~/.ssh/authorized_keys rac2:~/.ssh/authorized_keys

[grid@rac1~]$ ssh rac1 date
[grid@rac1~]$ ssh rac2 date
[grid@rac1~]$ ssh rac1-priv date
[grid@rac1~]$ ssh rac2-priv date

[grid@rac2~]$ ssh rac1 date
[grid@rac2~]$ ssh rac2 date
[grid@rac2~]$ ssh rac1-priv date
[grid@rac2~]$ ssh rac2-priv date

安装oracleasmlib程序包
oracleasm-support-2.1.8-1.el5.x86_64.rpm
oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm

配置ASM
[root@rac1 ~]# /etc/init.d/oracleasm configure -i (grid asadmin y y)
[root@rac1 ~]# /etc/init.d/oracleasm createdisk DATA1 /dev/sdb1
[root@rac1 ~]# /etc/init.d/oracleasm createdisk DATA2 /dev/sdc1
[root@rac1 ~]# /etc/init.d/oracleasm createdisk DATA3 /dev/sdd1
[root@rac1 ~]# /etc/init.d/oracleasm createdisk DATA4 /dev/sde1
[root@rac1 ~]# /etc/init.d/oracleasm scandisks
[root@rac1 ~]# /etc/init.d/oracleasm listdisks
[root@rac2 ~]# /etc/init.d/oracleasm scandisks
[root@rac2 ~]# /etc/init.d/oracleasm listdisks

使用CVU检查各个节点的配置工作(grid为linux_11gR2_grid.zip解压后的目录)
[grid@rac1 grid]$ ./runcluvfy.sh stage -pre crsinst -n rac1,rac2 -fixup -verbose

© 著作权归作者所有

楚云泽
粉丝 2
博文 17
码字总数 4215
作品 0
长宁
高级程序员
私信 提问
oracle 11G rac 安装(VMware + rhel6.3)

闲来有空,整理下VMware workstation上oracle 11 RAC的安装 环境: VMware Workstation :9.0.0 build-812388 OS :Red Hat Enterprise Linux Server release 6.3 (Santiago) Oracle :11203......

sugar黑黑
2015/10/10
0
0
Oracle 11g RAC搭建(VMware环境)

Oracle 11g RAC搭建(VMware环境) 安装环境与网络规划 安装环境 主机操作系统:windows 10 虚拟机VMware12:两台Oracle Linux R6 U5 x86_64 Oracle Database software: Oracle11gR2 Cluster...

lizer2016
2016/04/15
0
0
oracle 11g rac 笔记(VMware 和esxi主机都可以使用)

这个只是笔记,防止丢失,没事见整理 在vmware安装目录 创建磁盘: vmware-vdiskmanager.exe -c -s 1000Mb -a lsilogic -t 2 D:VMWAREracsharediskocr.vmdk vmware-vdiskmanager.exe -c -s 1......

674591788
2017/09/07
0
0
Vmware+RHEL5+Oracle 10G RAC安装实验--详细过程(一)

实验环境: 普通PC一台(3GB内存,500GB硬盘) Vmware Server 1.0.6版 RedHat Linux Enterprise 5.1 Oracle 10g for linux(10.2.0.1) 前言: 首先要感谢itpub里君三思学习笔记里的:《手把手...

pimg2005
2013/02/01
0
0
Linux系统Oracle12.2 RAC集群实施维护_Oracle数据库12cR2(项目实战之五)

课程目标 风哥Oracle数据库教程12cR2(项目实战系列)之五:Linux系统上Oracle 12.2 RAC实施与基本维护,包括系统安装与环境配置、ASM存储配置、Oracle 12cR2 RAC集群软件安装、RAC数据库软件...

风哥Oracle
2018/06/28
0
0

没有更多内容

加载失败,请刷新页面

加载更多

使用CSS自定义属性构建骨架屏

写在前面 几天前看到薄荷前端团队分享的《前端骨架屏方案小结》,突然回想起一年前看到的max bock写的《Building Skeleton Screens with CSS Custom Properties》,翻译整理写下出此文,分享...

前端老手
昨天
7
0
Docker常用命令小记

除了基本的<font color="blue">docker pull</font>、<font color="blue">docker image</font>、<font color="blue">docker ps</font>,还有一些命令及参数也很重要,在此记录下来避免遗忘。 ......

程序员欣宸
昨天
5
0
MAT使用-jvm内存溢出问题分析定位

1.MAT简介: MAT 全称 Eclipse Memory Analysis Tools 是一个分析 Java堆数据的专业工具,可以计算出内存中对象的实例数量、占用空间大小、引用关系等,看看是谁阻止了垃圾收集器的回收工作,...

xiaomin0322
昨天
5
0
内网和外网之间的通信(端口映射原理)

首先解释一下“内网”与“外网”的概念: 内网:即所说的局域网,比如学校的局域网,局域网内每台计算机的IP地址在本局域网内具有互异性,是不可重复的。但两个局域网内的内网IP可以有相同的...

Jack088
昨天
6
0
3.深入jvm内核-原理、诊断与优化-4. GC算法和种类

一、GC算法和种类 GC的概念 GC算法 引用计数法 标记清除 标记压缩 复制算法 可触及性 Stop-The-World GC的对象是堆空间和永久区 引用计数法 老牌垃圾回收算法 通过引用计算来回收垃圾 使用者...

hexiaoming123
昨天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部