RAC之srvctl 命令不能用的問題

靜以致遠√團團發表於2013-11-30
RAC好不容易裝好,在練習管理時發現srvctl命令不能用(我的環境:RedHat5.4+clusterware10.2+oracle10.2)

[oracle@node1 bin]$ srvctl 
/u01/oracle/10.2.0/db_1/jdk/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory

提示說是bin路徑不正確

[oracle@node1 bin]$ which srvctl
/u01/oracle/10.2.0/db_1/bin/srvctl
[oracle@node1 bin]$ echo $CRS_HOME
/u01/oracle/product/10.2.0/crs_1

發現srvctl的路徑果然不正確,跟我自己設定的CRS_HOME不一致,就考慮到是環境變數的問題:

[oracle@node1 bin]$ cat ~/.bash_profile 
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export ORACLE_SID=mydb1
export ORACLE_BASE=/u01/oracle
export CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1
export ORACLE_HOME=$ORACLE_BASE/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export EDITOR=vi
export PATH

環境變數配置無誤,並且如網上其他高手所說,CRS_HOME已經配置在ORACLE_HOME前面了,為啥還會出錯呢

又在網上找到資料,發現要想修改vipca一樣修改srvctl檔案:

[oracle@node2 ~]$ cd $CRS_HOME/bin
[oracle@node2 bin]$ vi srvctl 
修改以下兩行:
#Remove this workaround when the bug 3937317 is fixed
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
新增
unset LD_ASSUME_KERNEL
或者直接將這兩行註釋
#LD_ASSUME_KERNEL=2.4.19
#export LD_ASSUME_KERNEL

這下總可以了吧:
[oracle@node1 bin]$ srvctl
/u01/oracle/10.2.0/db_1/jdk/jre/bin/java: cannot open shared object file: No such file or directory
哦,麥噶登,還是不行

再次回來檢視該命令的路徑
[oracle@node1 bin]$ which srvctl
/u01/oracle/10.2.0/db_1/bin/srvctl

既然命令路徑不正確,修改CRS_HOME下的命令檔案肯定是沒用的,就去/u01/oracle/10.2.0/db_1/bin/瞅了瞅
果然有srvctl檔案,趕緊的修改這個命令檔案:

[oracle@node1 bin]$ cd /u01/oracle/10.2.0/db_1/bin/
[oracle@node1 bin]$ vi srvctl
老方法
#Remove this workaround when the bug 3937317 is fixed
LD_ASSUME_KERNEL=2.4.19
export LD_ASSUME_KERNEL
新增
unset LD_ASSUME_KERNEL
或者直接將這兩行註釋
#LD_ASSUME_KERNEL=2.4.19
#export LD_ASSUME_KERNEL

儲存退出,再試試:
[oracle@node1 bin]$ srvctl 
Usage: srvctl []
    command: enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config
    objects: database|instance|service|nodeapps|asm|listener
For detailed help on each command and object and its options use:
    srvctl -h
成功了!哈哈

總結:在安裝rac的時候,srvctl命令本身就是在/u01/oracle/10.2.0/db_1/bin/,只是修改CRS_HOME下的srvctl是沒有用的










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

相關文章