ITPUX技术网

交流 . 资讯 . 分享
Make progress together!
Linux操作系统下Oracle11g R2 RAC 安装配置教程
Oracle数据库培训-备份恢复-性能优化-集群容灾
Oracle数据库DBA高级工程师培训视频

虚拟机VMware下 Oracle RAC环境添加磁盘

内容发布:科比之圣| 发布时间:2017-5-14 10:41:51
虚拟机VMware Linux redhat 5 Oracle 10g RAC环境添加共享磁盘
1. 正常关闭虚拟机

2.编辑虚拟机,添加磁盘
主要步骤如下:

a.编辑虚拟机,添加磁盘

b.选择Hard Disk,点击下一步
c.选择SCSI类型
d.指定磁盘容量0.1G,选择分配所有磁盘空间
e.指定磁盘文件vmdk名称及存放路径
f.指定磁盘文件名称、位置后,点击高级选项
g.选择该次添加磁盘的虚拟设备号SCSI 1:8(按照已使用的顺序,本例中SCSI 1:7已被使用,之前共享scsi1:1scsi1:2scsi1:3scsi1:4scsi1:5scsi1:6),选择independentpersistent
h.磁盘添加完成
注:scsi1:7已被使用

i.编辑虚拟机配置文件
打开虚拟机VMware配置文件.vmx,本例虚拟机rac1节点的配置文件为Red Hat Linux.vmx,下面几行为添加磁盘后自动生成
scsi1:8.present = "TRUE"
scsi1:8.fileName = "D:\Virtual Machines\raw_disk\vote3.vmdk"
scsi1:8.mode = "independent-persistent"

手工添加下行:
scsi1:8.deviceType = "disk"

j.启动虚拟机

k.OS中查看刚才添加的磁盘
fdisk -l
……
Disk /dev/sdh: 107 MB, 107374080 bytes
64 heads, 32 sectors/track, 102 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sdh doesn't contain a valid partition table

格式化刚才添加的磁盘/dev/sdh
[root@rac1 ~]# fdisk /dev/sdh
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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-102, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-102, default 102):
Using default value 102

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

Calling ioctl() to re-read partition table.
Syncing disks.
为了配置刚才添加的磁盘为共享裸设备,通过udev编辑/etc/udev/rules.d/60-raw.rules
根据已有共享磁盘使用情况,添加如下内容:
ACTION=="add", KERNEL=="/dev/sdh1", RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="113",RUN+="/bin/raw /dev/raw/raw7 %M %m"

编辑下一行为:
KERNEL=="raw[1-7]", WNER="oracle", GROUP="oinstall", MODE="640"
指定设备属主、组和权限

Oracle RAC orcvotedisk权限如下:
For OCR device:
chmod 640

For Voting device:
chmod 644

For ASM disks used for OCR/Voting disk:
chmod 660

启动udev
[root@rac1 ~]# start_udev
Starting udev: [  OK  ]

查看刚才配置的raw device
[root@rac1 ~]# ls -ltrh /dev/raw/
total 0
crw-r----- 1 oracle oinstall 162, 1 Nov 25 20:26 raw1
crw-r----- 1 oracle oinstall 162, 5 Nov 25 20:26 raw5
crw-r----- 1 oracle oinstall 162, 7 Nov 25 20:57 raw7
crw-r----- 1 oracle oinstall 162, 3 Nov 25 20:58 raw3
crw-r----- 1 oracle oinstall 162, 4 Nov 25 20:59 raw4
crw-r----- 1 oracle oinstall 162, 2 Nov 25 20:59 raw2
crw-r----- 1 oracle oinstall 162, 6 Nov 25 20:59 raw6

l.关闭另一节点虚拟机rac2

j.编辑rac2虚拟机配置文件.vmx
添加如下刚才在虚拟机rac1上配置的共享磁盘信息,内容如下:
scsi1:8.deviceType = "disk"

scsi1:8.present = "TRUE"
scsi1:8.fileName = "D:\Virtual Machines\raw_disk\vote3.vmdk"
scsi1:8.mode = "independent-persistent"

编辑/etc/udev/rules.d/60-raw.rules,添加如下:
ACTION=="add", KERNEL=="/dev/sdh1", RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", ENV{MAJOR}=="8",ENV{MINOR}=="113",RUN+="/bin/raw /dev/raw/raw7 %M %m"

修改下行如下:
KERNEL=="raw[1-7]", WNER="oracle", GROUP="oinstall", MODE="640"

启动udev
[root@rac1 ~]# start_udev
Starting udev: [  OK  ]

查看共享设备:
[root@rac2 ~]# ls -ltrh /dev/raw/
total 0
crw-r----- 1 oracle oinstall 162, 3 Nov 25 21:40 raw3
crw-r----- 1 oracle oinstall 162, 4 Nov 25 21:40 raw4
crw-r----- 1 oracle oinstall 162, 6 Nov 25 21:44 raw6
crw-r----- 1 oracle oinstall 162, 2 Nov 25 21:44 raw2
crw-r----- 1 oracle oinstall 162, 5 Nov 25 21:46 raw5
crw-r----- 1 oracle oinstall 162, 1 Nov 25 21:46 raw1
crw-r----- 1 oracle oinstall 162, 7 Nov 25 21:46 raw7

k.使用刚才配置的共享设备创建votedisk
[root@rac2 ~]# crsctl add css votedisk /dev/raw/raw7 -force
Now formatting voting disk: /dev/raw/raw7
successful addition of votedisk /dev/raw/raw7.

查看votedisk
[root@rac2 ~]# crsctl query css votedisk
0.     0    /dev/raw/raw2
1.     0    /dev/raw/raw6
2.     0    /dev/raw/raw7

located 3 votedisk(s).

rac1节点上查看votedisk
[root@rac1 ~]# crsctl query css votedisk
0.     0    /dev/raw/raw2
1.     0    /dev/raw/raw6
2.     0    /dev/raw/raw7

located 3 votedisk(s).



上一篇:oracle 60-raw.rules和99-oracle-asmdevices.rules区别
下一篇:如何设置VMware中的Linux分辨率
回复

使用道具 举报

1框架
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表