执行VCS相关命令提示command not found

发布时间:  2015-05-06 浏览次数:  305 下载次数:  0
问题描述
现象描述
执行hastatus命令:
# hastatus
-bash: hastatus: command not found
版本信息
VCS版本:5.1SP1
操作系统:SUSE Linux Enterprise Server 11 SP1 (x86_64)
处理过程

PATH环境变量中缺少VCS相关路径信息。 
  oracle6251:/opt/VRTSvcs/bin # cd /opt/VRTSvcs/bin/ 
 

 

oracle6251:/opt/VRTSvcs/bin # echo $PATH
/usr/sbin:/sbin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/VRTS/bin:/opt/VRTSob/bin:/opt/VRTSvcs/bin
oracle6251:/opt/VRTSvcs/bin #

解决方案
处理步骤
步骤 1 root账户登录,检查/opt/VRTSvcs/bin,确保相关VCS的命令是存在的:
oracle6251: # cd /opt/VRTSvcs/bin
oracle6251:/opt/VRTS/bin # pwd; ls

步骤 2 用OS命令查看PATH环境变量设置:
oracle6251:/opt/VRTS/bin # echo $PATH
/usr/sbin:/sbin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin
如果PATH中的确少VCS相关路径信息,则按照如下示例方法将VCS路径添加到PATH中,下面。
oracle6251:/opt/VRTS/bin #export PATH=$PATH:/opt/VRTS/bin:/opt/VRTSob/bin:/opt/VRTSvcs/bin
再查询PATH环境变量:
oracle6251:/opt/VRTS/bin # echo $PATH
/usr/sbin:/sbin:/sbin:/usr/sbin:/usr/local/sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/VRTS/bin:/opt/VRTSob/bin:/opt/VRTSvcs/bin

步骤 3 将PATH设置添加到系统的/etc/profile文件末尾,确保系统重启后生效,添加后效果如下:
oracle6251:/opt/VRTS/bin # cat /etc/profile
……
#
# End of /etc/profile
#
PATH=/usr/sbin:/sbin:$PATH:/opt/VRTS/bin:/opt/VRTSob/bin:/opt/VRTSvcs/bin
export PATH
MANPATH=${MANPATH}:/opt/VRTS/man
export MANPATH

END