Determine your current kernel.
#rpm -qa | grep kernel
kernel-2.6.18-398.el5
kernel-uek-2.6.39-400.215.10.el5uek
# uname -rm
2.6.39-400.215.10.el5uek x86_64
#
If you prefer using UDEV over ASMLib, you can ignore the rest of this section. An example of UDEV setup is shown here.
Download the appropriate ASMLib RPMs from OTN. If you are using the UEK the ASMLib kernel module is present already. For RHEL kernel we would need all three of the following:
oracleasm-support-2.1.8-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-2.6.18-398.el5-2.0.5-1.el5.x86_64.rpm
oracleasm-[your-kernel-version].rpm (oracleasm 要与你的Linux内核版本要一致,及与kernel-2.6.18-398.el5一致)
Install the packages using the following command.
rpm -Uvh oracleasm*.rpm
Configure ASMLib using the following command.
# oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: dba (必须是dba组否则后面会报错)
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
#
Load the kernel module using the following command.
# /usr/sbin/oracleasm init
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
#
If you have any problems, run the following command to make sure you have the correct version of the driver.
安装好之后查看器配置信息:
#rpm -qa | grep kernel
kernel-2.6.18-398.el5
kernel-uek-2.6.39-400.215.10.el5uek
# uname -rm
2.6.39-400.215.10.el5uek x86_64
#
If you prefer using UDEV over ASMLib, you can ignore the rest of this section. An example of UDEV setup is shown here.
Download the appropriate ASMLib RPMs from OTN. If you are using the UEK the ASMLib kernel module is present already. For RHEL kernel we would need all three of the following:
oracleasm-support-2.1.8-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-2.6.18-398.el5-2.0.5-1.el5.x86_64.rpm
oracleasm-[your-kernel-version].rpm (oracleasm 要与你的Linux内核版本要一致,及与kernel-2.6.18-398.el5一致)
Install the packages using the following command.
rpm -Uvh oracleasm*.rpm
Configure ASMLib using the following command.
# oracleasm configure -i
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: dba (必须是dba组否则后面会报错)
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
#
Load the kernel module using the following command.
# /usr/sbin/oracleasm init
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
#
If you have any problems, run the following command to make sure you have the correct version of the driver.
安装好之后查看器配置信息:
/usr/sbin/oracleasm configure (对oracleasm的配置进行查看)
cat /etc/sysconfig/oracleasm (对oracleasm的配置进行查看)
# /usr/sbin/oracleasm update-driver
Mark the five shared disks as follows.
# /usr/sbin/oracleasm createdisk DISK1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
# /usr/sbin/oracleasm createdisk DISK2 /dev/sdc1
Writing disk header: done
Instantiating disk: done
# /usr/sbin/oracleasm createdisk DISK3 /dev/sdd1
Writing disk header: done
Instantiating disk: done
# /usr/sbin/oracleasm createdisk DISK4 /dev/sde1
Writing disk header: done
Instantiating disk: done
#
It is unnecessary, but we can run the "scandisks" command to refresh the ASM disk configuration.
# /usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
#
We can see the disk are now visible to ASM using the "listdisks" command.
# /usr/sbin/oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
#