例如:
# rpm -Uvh
> Oracleasm-2.4.9-e-smp-1.0.0-1.i686.rpm
> Oracleasmlib-1.0.0-1.i386.rpm
> Oracleasm-support-1.0.0-1.i386.rpm
Preparing... #################################### [100%]
1:Oracleasm-support #################################### [ 33%]
2:Oracleasm-2.4.9-e-smp #################################### [ 66%]
Linking module Oracleasm.o into the module path [ OK ]
3:Oracleasmlib #################################### [100%] |
配置 ASMLib
使用 ASMLib 之前,必须运行配置脚本以准备驱动程序。以 root 用户身份运行以下命令,并响应如下示例中所显示的提示。
# /etc/init.d/Oracleasm configure
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 []:Oracle
Default group to own the driver interface []:dba
Start Oracle ASM library driver on boot (y/n) [n]:y
Fix permissions of Oracle ASM disks on boot (y/n) [y]:y
Writing Oracle ASM library driver configuration [ OK ]
Creating /dev/Oracleasm mount point [ OK ]
Loading module "Oracleasm" [ OK ]
Mounting ASMlib driver filesystem [ OK ]
Scanning system for ASM disks [ OK ] |
现在,如下所示启用 ASMLib 驱动程序。
# /etc/init.d/Oracleasm enable
Writing Oracle ASM library driver configuration [ OK ]
Scanning system for ASM disks [ OK ] |
为 ASM 配置磁盘
接下来,告诉 ASM 驱动程序您要使用的磁盘。请注意,这些磁盘是不包含任何内容(甚至不包含分区)的空磁盘。可以将磁盘分区用于 ASM,但建议您不要这样做。
通过以 root 用户身份运行以下命令来标记由 ASMLib 使用的磁盘:
/etc/init.d/Oracleasm createdisk DISK_NAME device_name
(提示:DISK_NAME 应由大写字母组成。当前版本有一个错误,即如果使用小写字母,ASM 实例将无法识别磁盘。)
例如:
# /etc/init.d/Oracleasm createdisk VOL1 /dev/sdb
Marking disk "/dev/sdb" as an ASM disk [ OK ]
# /etc/init.d/Oracleasm createdisk VOL2 /dev/sdc
Marking disk "/dev/sdc" as an ASM disk [ OK ]
# /etc/init.d/Oracleasm createdisk VOL3 /dev/sdd
Marking disk "/dev/sdd" as an ASM disk [ OK ]
# /etc/init.d/Oracleasm createdisk VOL4 /dev/sdf
Marking disk "/dev/sdf" as an ASM disk [ OK ]
# /etc/init.d/Oracleasm createdisk VOL5 /dev/sdg
Marking disk "/dev/sdg" as an ASM disk [ OK ]
# /etc/init.d/Oracleasm createdisk VOL6 /dev/sdh
Marking disk "/dev/sdh" as an ASM disk [ OK ] |