***********************************************声明**********************************************
原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处,否则追究版权法律责任。
表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。
本文转载必须保留此处:http://blog.csdn.net/huangyanlong/article/details/39225813
深蓝的blog:http://blog.csdn.net/huangyanlong
***************************************************************************************************
问题现象
计划在CentOS5.6(64bit)操作系统上搭建Oracle11g集群,前期使用Red Hat5(32bit)的asm包,后下载src包,安装未果。重新下载asm包,经过正确安装asm包后完成asm的创建。问题不大,却由于版本思路定位不正确,造成过多无用操作。
不太正确的操作流程
1、安装asm包,创建asm磁盘时报错;
2、下载src包,尝试安装,未果;
3、到官网下载asm包,版本不正确;
4、重新到官网下载asm包,再次安装;
5、完成创建asm。
1、安装asm包,创建asm磁盘时报错
[root@hyl1 ~]# service oracleasm configure --配置asm报错了
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASMlibrary
driver. The followingquestions 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]: grid
Default group to own the driver interface [asmadmin]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [FAILED]
2、下载src包,尝试安装,未果
[root@hyl1 /]# uname -a --查询系统内核版本
Linux hyl1 2.6.18-238.el5xen #1 SMP Thu Jan 13 16:41:45 EST 2011x86_64 x86_64 x86_64 GNU/Linux
到oracle官网下载安装包:参考链接https://oss.oracle.com/ol5/SRPMS-updates/
上传asm安装包
安装src.rpm文件出现问题,初期如下使用yum安装依赖包
光盘配置yum
[root@hyl1 CentOS]# yum install -yrpm-build*
[root@hyl1 CentOS]# yum -y installrpm-build
网上查看资料,安装src.rpm带着更多问题,无法继续
想办法,想直接到官网找到rpm包如下方式
3、到官网下载asm包,版本不正确
到网站重新查找安装包:
http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html到Linux5 AS版本选项,点击:
下载rpm安装包
找到lib和support包
上传asm包,查看上传结果
[root@hyl1 asm]# ls -lh
total 236K
-rw-r--r-- 1 root root 126K Jul 29 13:06oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.i686.rpm
-rw-r--r-- 1 root root 14K Jul 29 13:06 oracleasmlib-2.0.4-1.el5.i386.rpm
-rw-r--r-- 1 root root 84K Jul 29 13:06 oracleasm-support-2.1.8-1.el5.i386.rpm
[root@hyl1 asm]# uname -a --核实系统内核版本
Linux hyl1 2.6.18-238.el5xen #1 SMP Thu Jan 13 16:41:45 EST 2011x86_64 x86_64 x86_64 GNU/Linux
节点1:
[root@hyl1 asm]# rpm -ivh * --安装asm包
warning: oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.i686.rpm:Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.18-238.el########################################### [67%]
3:oracleasmlib ########################################### [100%]
[root@hyl1 asm]# rpm -qa |grep asm --查询asm包安装情况
oracleasm-support-2.1.8-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5
[root@hyl1 asm]# scp /soft/asm/* hyl2:/soft/asm --将安装包拷贝到节点2
root@hyl2‘s password:
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.i686.rpm 100% 126KB 125.8KB/s 00:00
oracleasmlib-2.0.4-1.el5.i386.rpm 100% 14KB 13.6KB/s 00:00
oracleasm-support-2.1.8-1.el5.i386.rpm 100% 83KB 83.3KB/s 00:00
节点2:
到节点2下安装asm包
[root@hyl2 asm]# rpm -ivh *
warning: oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.i686.rpm:Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.18-238.el###########################################[ 67%]
3:oracleasmlib ########################################### [100%]
[root@hyl2 asm]# rpm -qa|grep asm
oracleasm-support-2.1.8-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5
[root@hyl1 ~]# service oracleasm configure --配置asm报错了
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASMlibrary
driver. The followingquestions 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]: grid
Default group to own the driver interface [asmadmin]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [FAILED]
[root@hyl1 ~]# more /var/log/oracleasm --查看asm日志文件
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": failed
Unable to load module "oracleasm"
Loading module "oracleasm": failed
Unable to load module "oracleasm"
到网站下载了另一个包
[root@hyl1 asm2]# rpm -ivhoracleasm-2.6.18-238.el5-2.0.5-1.el5.i686.rpm
warning: oracleasm-2.6.18-238.el5-2.0.5-1.el5.i686.rpm: HeaderV3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-2.6.18-238.el###########################################[100%]
[root@hyl1 asm]# /etc/init.d/oracleasmenable --错误依旧
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [FAILED]
[root@hyl1 asm3]# find / -name oracleasm.ko
/lib/modules/2.6.18-238.el5/kernel/drivers/addon/oracleasm/oracleasm.ko
/lib/modules/2.6.18-238.el5xen/kernel/drivers/addon/oracleasm/oracleasm.ko
将oracleasm卸载掉
[root@hyl1 asm4]# rpm -qa |grep asm
oracleasm-support-2.1.8-1.el5
oracleasm-2.6.18-238.el5-2.0.5-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5
[root@hyl1 asm4]# rpm -eoracleasmlib-2.0.4-1.el5
[root@hyl1 asm4]# rpm -e oracleasm-2.6.18-238.el5-2.0.5-1.el5
[root@hyl1 asm4]# rpm -eoracleasm-2.6.18-238.el5xen-2.0.5-1.el5
[root@hyl1 asm4]# rpm -eoracleasm-support-2.1.8-1.el5
warning: /etc/sysconfig/oracleasm saved as/etc/sysconfig/oracleasm.rpmsave
[root@hyl1 asm4]# rpm -qa |grep asm --卸载完成
4、重新到官网下载asm包,再次安装
尝试安装其他版本,发现不行,卸载掉,注意卸载顺序:lib—el5—el5xen—support
[root@hyl1 asm5]# rpm -qa|grep asm
oracleasm-2.6.18-194.el5-2.0.5-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-support-2.1.3-1.el5
[root@hyl1 asm5]# rpm -e oracleasmlib-2.0.4-1.el5
[root@hyl1 asm5]# rpm -eoracleasm-2.6.18-194.el5-2.0.5-1.el5
[root@hyl1 asm5]# rpm -eoracleasm-support-2.1.3-1.el5
[root@hyl1 asm5]# rpm -qa |grep asm
重新下载asm包安装
[root@hyl1 asm4]# ls
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.x86_64.rpm oracleasm-support-2.1.8-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
[root@hyl1 asm4]# rpm -ivh *
warning: oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.x86_64.rpm:Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.18-238.el########################################### [67%]
3:oracleasmlib ###########################################[100%]
[root@hyl1 asm4]# rpm -qa |grep asm
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5
oracleasm-support-2.1.8-1.el5
oracleasmlib-2.0.4-1.el5
[root@hyl1 asm4]# ls
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.x86_64.rpm oracleasm-support-2.1.8-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
[root@hyl1 asm4]# service oracleasmconfigure --这次成功了,确定是asm包版本的原因
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASMlibrary
driver. The followingquestions 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 [asmadmin]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@hyl1 soft]# scp /soft/asm4/* hyl2:/soft --把节点1上的asm安装包远程拷贝到节点2上
root@hyl2‘s password:
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.x86_64.rpm 100% 133KB 133.5KB/s 00:00
oracleasmlib-2.0.4-1.el5.x86_64.rpm 100% 14KB 13.8KB/s 00:00
oracleasm-support-2.1.8-1.el5.x86_64.rpm 100% 88KB 88.1KB/s 00:00
节点2:
卸载掉版本不对的asm安装包(之前安装版本有问题,在节点1问题已经出现)
[root@hyl2 log]# rpm -qa |grep asm
oracleasm-support-2.1.8-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5
[root@hyl2 log]# rpm -eoracleasmlib-2.0.4-1.el5
[root@hyl2 log]# rpm -eoracleasm-2.6.18-238.el5xen-2.0.5-1.el5
[root@hyl2 log]# rpm -eoracleasm-support-2.1.8-1.el5
[root@hyl2 log]# rpm -qa |grep asm
节点2:
[root@hyl2 soft]# rpm -ivh * --节点2上安装asm包
warning: oracleasm-2.6.18-238.el5xen-2.0.5-1.el5.x86_64.rpm: HeaderV3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [ 33%]
2:oracleasm-2.6.18-238.el########################################### [67%]
3:oracleasmlib ########################################### [100%]
[root@hyl2 soft]# rpm -qa |grep asm
oracleasm-support-2.1.8-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5
[root@hyl2 soft]# service oracleasmconfigure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASMlibrary
driver. The followingquestions 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 []:asmadmin
Start Oracle ASM library driver on boot (y/n) [n]:y
Scan for Oracle ASM disks on boot (y/n) [y]:y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
5、完成创建asm
节点1:
[root@hyl1 soft]# service oracleasm
Usage: /etc/init.d/oracleasm{start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@hyl1 soft]# service oracleasm creatediskOCR_VOTE1 /dev/sdb1
Marking disk "OCR_VOTE1" as an ASM disk: [ OK ]
[root@hyl1 soft]# service oracleasmcreatedisk OCR_VOTE2 /dev/sdb2
Marking disk "OCR_VOTE2" as an ASM disk: [ OK ]
[root@hyl1 soft]# service oracleasmcreatedisk OCR_VOTE3 /dev/sdb3
Marking disk "OCR_VOTE3" as an ASM disk: [ OK ]
[root@hyl1 soft]# service oracleasmcreatedisk ASM_DATA1 /dev/sdb5
Marking disk "ASM_DATA1" as an ASM disk: [ OK ]
[root@hyl1 soft]# service oracleasmcreatedisk ASM_DATA2 /dev/sdb6
Marking disk "ASM_DATA2" as an ASM disk: [ OK ]
[root@hyl1 soft]# service oracleasmcreatedisk ASM_RCY1 /dev/sdb7
Marking disk "ASM_RCY1" as an ASM disk: [ OK ]
[root@hyl1 soft]# service oracleasmcreatedisk ASM_RCY2 /dev/sdb8
Marking disk "ASM_RCY2" as an ASM disk: [ OK ]
[root@hyl1 soft]# service oracleasmlistdisks --查看asm创建结果
ASM_DATA1
ASM_DATA2
ASM_RCY1
ASM_RCY2
OCR_VOTE1
OCR_VOTE2
OCR_VOTE3
节点2:
[root@hyl2 soft]# service oracleasmscandisks --扫描共享存储
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@hyl2 soft]# service oracleasmlistdisks --查看共享存储磁盘信息
ASM_DATA1
ASM_DATA2
ASM_RCY1
ASM_RCY2
OCR_VOTE1
OCR_VOTE2
OCR_VOTE3
小结
1、配置asm时,如果出现如下现象错误,请检查:asm包、系统版本是否匹配
[root@hyl1 ~]# service oracleasm configure --配置asm报错了
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASMlibrary
driver. The followingquestions 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]: grid
Default group to own the driver interface [asmadmin]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [FAILED]
2、查看系统版本命令
[root@hyl1 asm]# uname -a --核实系统内核版本
Linux hyl1 2.6.18-238.el5xen #1 SMP Thu Jan 13 16:41:45 EST 2011x86_64 x86_64 x86_64 GNU/Linux
3、卸载时注意
尝试安装其他版本,发现不行,卸载掉,注意卸载顺序:lib—el5—el5xen—support
[root@hyl1 asm5]# rpm -qa|grep asm
oracleasm-2.6.18-194.el5-2.0.5-1.el5
oracleasmlib-2.0.4-1.el5
oracleasm-support-2.1.3-1.el5
[root@hyl1 asm5]# rpm -e oracleasmlib-2.0.4-1.el5
[root@hyl1 asm5]# rpm -eoracleasm-2.6.18-194.el5-2.0.5-1.el5
[root@hyl1 asm5]# rpm -eoracleasm-support-2.1.3-1.el5
[root@hyl1 asm5]# rpm -qa |grep asm
4、查询asm包指令
[root@hyl1 asm4]# rpm -qa |grep asm
oracleasm-2.6.18-238.el5xen-2.0.5-1.el5
oracleasm-support-2.1.8-1.el5
oracleasmlib-2.0.4-1.el5
5、如何快速的下载asm包
我的另一篇文章介绍:http://blog.csdn.net/huangyanlong/article/details/38266167
6、总结下安装思路
查询系统版本—官网下载对应的asm包—安装asm包—检查asm包—配置asm—创建asm
***********************************************声明**********************************************
原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处,否则追究版权法律责任。
表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。
本文转载必须保留此处:http://blog.csdn.net/huangyanlong/article/details/39225813
深蓝的blog:http://blog.csdn.net/huangyanlong
***************************************************************************************************