此次实验是基于Red Hat Enterprise Linux 4系统的实验:
[root@www~]# cat /proc/version
Linux version 2.6.9-67.ELsmp (brewbuilder@ls20-bc1-14.build.RedHat.com) (gcc version 3.4.620060404(Red Hat 3.4.6-8)) #1SMP Wed Nov 713:58:04EST 2007
[[email protected] ~]# cat /proc/version
Linux version 2.6.9-67.ELsmp ([email protected]) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-8)) #1 SMP Wed Nov 7 13:58:04 EST 2007
Library and Tools
oracleasm-support-2.1.3-1.el4.i386.rpm
oracleasmlib-2.0.4-1.el4.i386.rpm
Drivers for kernel 2.6.9-67.0.22.EL
oracleasm-2.6.9-67.0.22.ELxenU-2.0.3-1.i686.rpm
oracleasm-2.6.9-67.0.22.ELsmp-2.0.3-1.i686.rpm
oracleasm-2.6.9-67.0.22.ELhugemem-2.0.3-1.i686.rpm
oracleasm-2.6.9-67.0.22.EL-2.0.3-1.i686.rpm
安装: Java代码
[root@www~]# rpm -Uvh oracleasm-support-2.1.3-1.el4.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[root@www~]# rpm -Uvh oracleasm-2.6.9-67.0.22.EL-2.0.3-1.i686.rpm
Preparing... ########################################### [100%]
1:oracleasm-2.6.9-67.0.22########################################### [100%]
[root@www~]# rpm -Uvh oracleasmlib-2.0.4-1.el4.i386.rpm
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
[[email protected] ~]# rpm -Uvh oracleasm-support-2.1.3-1.el4.i386.rpm
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[[email protected] ~]# rpm -Uvh oracleasm-2.6.9-67.0.22.EL-2.0.3-1.i686.rpm
Preparing... ########################################### [100%]
1:oracleasm-2.6.9-67.0.22########################################### [100%]
[[email protected] ~]# rpm -Uvh oracleasmlib-2.0.4-1.el4.i386.rpm
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
配置: Java代码
[root@www~]# vi /etc/sysconfig/rawdevices
[root@www~]# cat /etc/sysconfig/rawdevices
# This file and interfaceare deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
# raw device bindings
# format:
#
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 85
/dev/raw/raw1 /dev/sdd1
/dev/raw/raw2 /dev/sde1
/dev/raw/raw3 /dev/sdf1
/dev/raw/raw4 /dev/sdg1
[root@www~]# /sbin/service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/sdd1
/dev/raw/raw1: bound to major 8, minor 49
/dev/raw/raw2 --> /dev/sde1
/dev/raw/raw2: bound to major 8, minor 65
/dev/raw/raw3 --> /dev/sdf1
/dev/raw/raw3: bound to major 8, minor 81
/dev/raw/raw4 --> /dev/sdg1
/dev/raw/raw4: bound to major 8, minor 97
done
[root@www~]# chown oracle:oinstall /dev/raw/raw[1-4]
[root@www~]# chmod 660/dev/raw/raw[1-4]
修改 /etc/udev/permissions.d/50-udev.permissions。原始设备在引导时会
重新映射。默认情况下,在引导时原始设备的拥有者将更改为 root 用户。如果
拥有者不是 oracle 用户,则 ASM 在访问共享分区时会出现问题。在
/etc/udev/permissions.d/50-udev.permissions 中为原始行
“raw/*:root:disk:0660”添加注释,然后添加一个新行
“raw/*:oracle:dba:0660”。
[root@www~]# vi /etc/udev/permissions.d/50-udev.permissions
# raw devices
ram*:root:disk:0660
#raw/*:root:disk:0660
raw/*:oracle:dba:0660
oracle登录
[oracle@wwworacle]$ ln -sf /dev/raw/raw1 /db/oracle/oracle/asmdisk1
[oracle@wwworacle]$ ln -sf /dev/raw/raw2 /db/oracle/oracle/asmdisk2
[oracle@wwworacle]$ ln -sf /dev/raw/raw3 /db/oracle/oracle/asmdisk3
[oracle@wwworacle]$ ln -sf /dev/raw/raw4 /db/oracle/oracle/asmdisk4
[oracle@wwworacle]$ ls
asmdisk1 asmdisk2 asmdisk3 asmdisk4 product
[oracle@wwworacle]$ ll
total 24
lrwxrwxrwx 1oracle oinstall 13Oct 2215:51asmdisk1 -> /dev/raw/raw1
lrwxrwxrwx 1oracle oinstall 13Oct 2215:51asmdisk2 -> /dev/raw/raw2
lrwxrwxrwx 1oracle oinstall 13Oct 2215:51asmdisk3 -> /dev/raw/raw3
lrwxrwxrwx 1oracle oinstall 13Oct 2215:51asmdisk4 -> /dev/raw/raw4
drwxrwx--- 3oracle oinstall 4096Oct 1422:38product