|
在使用srvctl出现以下错误: [oracle@rac1 ~]$ srvctl/u01/app/oracle/product/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 [oracle@rac1 ~]$ which srvctl/u01/app/oracle/product/10.2.0/db_1/bin/srvctl 可以发现目前的srvctl 是在$ORACLE_HOME目录下的,而不是$ORA_CRS_HOME目录下的. 从oralce用户的.bash_profile中的环境变量PATH可以发现$ORACLE_HOME出现在$ORACLE_CRS_HOME前面,调用srvctl命令的时候,系统会自动去查找出现在最前面环境变量目录下的srvctl. [oracle@rac1 ~]$ cat .bash_profile# .bash_profile
# Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi
# User specific environment and startup programs
export TMP=/tmpexport TMPDIR=$TMPexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1export ORACLE_SID=racdb1export ORACLE_TERM=xtermexport PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin/:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlibumask 022
PATH=$PATH:$HOME/bin
export PATH[oracle@rac1 ~]$ 调换下$ORACLE_HOME和$ORA_CRS_HOME即可: [oracle@rac1 ~]$ vi .bash_profile# .bash_profile
# Get the aliases and functionsif [ -f ~/.bashrc ]; then . ~/.bashrcfi
# User specific environment and startup programs
export TMP=/tmpexport TMPDIR=$TMPexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1export ORACLE_SID=racdb1export ORACLE_TERM=xtermexport PATH=$ORA_CRS_HOME/bin:$ORACLE_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin/:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlibumask 022
PATH=$PATH:$HOME/bin
export PATH~~~~".bash_profile" 24L, 651C written [oracle@rac1 ~]$ . .bash_profile[oracle@rac1 ~]$ [oracle@rac1 ~]$ srvctl
Usage: srvctl <command> <object> [<options>]
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 <command> <object> -h 版权声明:本文为博主原创文章,未经博主允许不得转载。 |
|