1、在系统上安装ORACLEASM需要的包
查看系统版本
uname -r
当前环境是
2.6.18-164.el5
下载相应的包进行安装
http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html
下载
oracleasm-support-2.1.7-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm
然后进行安装
rpm -ivh oracleasm-support-2.1.7-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm
2、准备磁盘
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
fdisk /dev/sde
产生
/dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
3、初始化
/etc/init.d/oracleasm enable
/etc/init.d/oracleasm configure
Default user to own the driver interface [oracle]:
Default group to own the driver interface [oinstall]:
Start Oracle ASM library driver on boot (y/n) [y]:
Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: [ OK ]
Scanning system for ASM disks: [ OK ]
4、制作ASM磁盘
/etc/init.d/oracleasm createdisk D1 /dev/sdb1
/etc/init.d/oracleasm createdisk D2 /dev/sdc1
/etc/init.d/oracleasm createdisk D3 /dev/sdd1
/etc/init.d/oracleasm createdisk D4 /dev/sde1
5、使用DBCA创建ASM实例
根据DBCA的提示,需要在root用户下执行
/u01/app/oracle/product/10.2.0/db_1/bin/localconfig add
如果启动不正常,或者有磁盘没有认出的情况则需要
/u01/app/oracle/product/10.2.0/db_1/bin/localconfig reset
并且在DBCA中设置识别位置Change Disk Discovery Path,设置其为
/dev/oracleasm/disks/*
选择4块磁盘,做成NORMAL模式即可(一份冗余)
这样就完毕了。
错误:
中途碰到识别不了磁盘就查看selinux是否打开,如果打开则关闭selinux
如果在建立ASM磁盘组的时候遭遇ORA-00600: internal error code, arguments: [kfmNew], [2], [], [], [], [], [], []
则查看一下ASM实例是否已经启动,如果启动,则需要将其关闭,然后重新启动ASM实例再进行创建。
此时如果查看日志/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/dbca/trace.log是会看到
ASM m_bReaderStarted: false的。