1.所有的配置和文件系统一样
2.规划:
加了8块小盘,ASM为了实验使用asmlib驱动(rhel6不再支持asmlib驱动),裸设备的2种方法(rowdevice和udev)
三块盘使用asmlib,两块使用rowdevice,两块使用udev
2.分区
(1)查看
[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 System
(2)fdisk /dev/sdb
指令顺序:n -- p -- 1 -- 回车 -- 回车 -- w
/dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi 执行相同的操作
3.创建磁盘组及裸设备
[root@10gasm ~]# uname -rm
2.6.18-308.el5 x86_64
下载地址:http://www.oracle.com/technetwork/server-storage/linux/downloads/index-088143.html
创建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}
[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配置的裸设备
3,开始安装oracle soft
执行runInstaller(推荐在安装软件的时候不要新建ASM磁盘和实例,在dbca建库的时候再创建ASM实例)
在dbca的时候创建ASM
上图可见,所有的裸设备都已经被识别
,好了,开始选择所需要的磁盘设备,单击下一步开始安装。
4,安装的过程中遇到的一些问题
第一,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实例可以启动了
如果不能执行,重启系统。
第二,上面的问题解决后,在创建ASM实例的时候又报下面的ora-00600错误
解决:
在网上查了一下。修改了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以前的都可能导致这个错误的产生。