加了8块小盘,ASM为了实验使用asmlib驱动(rhel6再也不支持asmlib驱动),裸设备的2种方法(rowdevice和udev)css
三块盘使用asmlib,两块使用rowdevice,两块使用udevhtml
(1)查看node
[root@10gasm ~]# fdisk -l
Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1958 15623212+ 8e Linux LVM
Disk /dev/sdb: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdg: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdh: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Disk /dev/sdi: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id Systemlinux
(2)fdisk /dev/sdb网络
指令顺序:n -- p -- 1 -- 回车 -- 回车 -- w oracle
/dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi 执行相同的操做oop
[root@10gasm ~]# uname -rmspa
2.6.18-308.el5 x86_64ssr
下载地址:http://www.oracle.com/technetwork/server-storage/linux/downloads/index-088143.html3d
建立ASM磁盘组
(1)下面这种方式是经过asmlib建立磁盘组,在建立
/etc/init.d/oracleasm configure
/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 scandisks
/etc/init.d/oracleasm listdisks
(2)下面这种方式经过rowdeviece方式配置
配置文件/etc/sysconfig/rawdevices
添加:
/dev/raw/raw1 /dev/sde1
/dev/raw/raw2 /dev/sdf1
/dev/raw/raw3 /dev/sdg1
启动服务
/etc/init.d/rawdevices start
查看
[root@10gasm ~]# raw -qa
/dev/raw/raw1: bound to major 8, minor 65
/dev/raw/raw2: bound to major 8, minor 81
/dev/raw/raw3: bound to major 8, minor 97
修改权限
chown oracle:oinstall /dev/raw/raw{1,2,3}
chmod 660 /dev/raw/raw{1,2,3}
上面的两条命令加入到/etc/rc.d/rc.local文件中,以便重启时附权
[root@10gasm ~]# ls -l /dev/raw
total 0
crw-rw---- 1 oracle oinstall 162, 1 Sep 2 19:24 raw1
crw-rw---- 1 oracle oinstall 162, 2 Sep 2 19:24 raw2
crw-rw---- 1 oracle oinstall 162, 3 Sep 2 19:24 raw3
(3)使用udev方式
[root@10gasm raw]# vi /etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
#
# An example would be:
# ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw5 %M %m"
# to bind /dev/raw/raw5 to the device with major 8, minor 1.
ACTION=="add", KERNEL=="sdh1", RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add", KERNEL=="sdi1", RUN+="/bin/raw /dev/raw/raw5 %N"
KERNEL=="raw[4-5]", OWNER="oracle", GROUP="oinstall", MODE="660"
重启服务
/sbin/start_udev
查看:
[root@10gasm ~]# ls -l /dev/raw
total 0
crw------- 1 root root 162, 1 Sep 2 19:24 raw1
crw------- 1 root root 162, 2 Sep 2 19:24 raw2
crw------- 1 root root 162, 3 Sep 2 19:24 raw3
crw-rw---- 1 oracle oinstall 162, 4 Sep 2 19:33 raw4
crw-rw---- 1 oracle oinstall 162, 5 Sep 2 19:33 raw5
下面的raw4 ,raw5 为用udev绑定的设备,这样的好处是能够直接把权限和属组等直接附给裸设备,重启后不须要再次修改权限,而是用上面rawdevice方式,须要手动修改裸设备的权限。
到如今能够供ASM磁盘使用的裸设备有:
3个磁盘组V1 V2 V3
3块儿rawdevece配置的裸设备
2块儿udev配置的裸设备
执行runInstaller(推荐在安装软件的时候不要新建ASM磁盘和实例,在dbca建库的时候再建立ASM实例)
推荐:在dbca的时候建立ASM
上图可见,全部的裸设备都已经被识别
,好了,开始选择所须要的磁盘设备,单击下一步开始安装。
解决
Please run the following batch files in the $ORACLE_HOME/bin directory(在root用户下)
localconfig delete
[root@localhost bin]# ./localconfig delete
/etc/init.d/init.cssd: line 519: /etc/oracle/scls_scr/localhost/root/cssrun: 没
有那个文件或目录
/bin/touch: cannot touch ‘/etc/oracle/scls_scr/localhost/root/nooprocd’: 没有
那个文件或目录
/bin/touch: cannot touch ‘/etc/oracle/scls_scr/localhost/root/noclsmon’: 没有
那个文件或目录
Stopping CSSD.
Failure in CSS initialization opening OCR.
Shutdown has begun. The daemons should exit soon.
localconfig add
[root@localhost bin]# ./localconfig add
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
localhost
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
This will help you to solve your problem
问题解决了,asm实例能够启动了
若是不能执行,重启系统。
解决:
在网上查了一下。修改了hostname后会致使这个问题。和朋友确认了一下,确实有修改过机器的hostname,缘由肯定清楚了,着手解决就很简单了,修改/etc/hosts文件,加入hostanme便可。
其余说明:Oracle的meatlink上文档Doc ID: Note:5486074.8的描述:当Oracle没法肯定主机名或者网络地址的时候,会出现这个错误信息。Oracle在10.2.0.4和11.1.0.6中解决了这个bug。Oracle的metalink上指出在10.2.0.4之前的均可能致使这个错误的产生。