oracle ASM錯誤Initializing the Oracle ASMLib driver:[FAILED]

dbahaoyuan發表於2014-12-06

Centos 5.8, kernel為:
uname -r
2.6.18-308.el5

安裝ASM三個包:
rpm -ivh oracleasm-support-2.1.1-1.el4.i386.rpm
rpm -ivh oracleasm-2.6.18-128.el5-2.0.5-1.el5.i686.rpm
rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm

這三個包可以在下載到。

安裝完成之後,進行配置
[root@digdeep oracle]# /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 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) [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@digdeep oracle]#
發生了錯誤。

在晚上找了一下,發現很多類似的錯誤。大部分說是沒有關 selinux,或者版本不對。但是我的selinux在安裝centos時,就關閉了。

看一下日誌:
[root@digdeep oracle]# cat /var/log/oracleasm
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"
... ...
載入oracleasm這個 module 失敗

[root@digdeep oracle]# ls -l /lib/modules/
total 16
drwxr-xr-x 3 root root 4096 Dec 29 19:58 2.6.18-128.el5
drwxr-xr-x 6 root root 4096 Dec 29 17:16 2.6.18-308.24.1.el5
drwxr-xr-x 6 root root 4096 Dec 28 04:29 2.6.18-308.el5

[root@digdeep modules]# find -name oracleasm.ko
./2.6.18-128.el5/kernel/drivers/addon/oracleasm/oracleasm.ko

表明:module oracleasm.ko 確實存在!
但是系統不能呼叫到:
[root@digdeep oracleasm]# /sbin/insmod oracleasm.ko
[root@digdeep oracleasm]# echo $?
0

[root@digdeep oracle]# /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 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) [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  ]

錯誤搞定。

/etc/init.d/oracleasm configure時的錯誤搞定了,但是在reboot Centos時,又發生了同樣的錯誤:
  

網上很多說是與kenel的版本不對,於是又重新下載正確的版本的rpm包:
oracleasm-support-2.1.7-1.el5.i386.rpm
oracleasm-2.6.18-308.24.1.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm

重新安裝:
rpm -Uvh oracleasm-support-2.1.7-1.el5.i386.rpm
rpm -Uvh oracleasm-2.6.18-308.24.1.el5-2.0.5-1.el5.i686.rpm
rpm -Uvh oracleasmlib-2.0.4-1.el5.i386.rpm

然後再 reboot 或者 init 6,發現錯誤消失:
 

看來版本正確很重要。

第三個常見的錯誤是:
ORA-29701: unable to connect to Cluster Manager

解決方法是:
以root身份在$ORACLE_HOME/bin下執行:
localconfig add

如果還不行,則在$ORACLE_HOME/bin執行
localconfig delete
localconfig add

即可解決。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30031456/viewspace-1358783/,如需轉載,請註明出處,否則將追究法律責任。

相關文章