ITPub博客

首页 > 数据库 > 数据库开发技术 > DB2:ksh: db2: not found.

DB2:ksh: db2: not found.

原创 数据库开发技术 作者:jackson198574 时间:2014-06-16 11:43:35 0 删除 编辑
  



问题:

新建的用户无法执行相关的db2命令。
# su - test
$ db2 list active databases
ksh: db2:  not found.


但是实例用户可以连接:


# su - db2inst1
$ db2 connect to testdb user test using test


   Database Connection Information


 Database server        = DB2/AIX64 9.5.2
 SQL authorization ID   = TEST
 Local database alias   = TESTDB


解决方法:
在新建用户的环境变量中,加入实例名目录下包含相关命令的文件夹路径即可,有个通用的脚本,参照如下操作:
$ vi .profile
".profile" 9 lines, 254 characters 




PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.


export PATH


if [ -s "$MAIL" ]           # This is at Shell startup.  In normal
then echo "$MAILMSG"        # operation, the Shell checks
fi                          # periodically.






# The following three lines have been added by IBM DB2 instance utilities.
if [ -f /dbinfo_db1/db2inst1/sqllib/db2profile ]; then           --------------db2inst1路径要使用实际环境中的相关实例名代替
    . /dbinfo_db1/db2inist1/sqllib/db2profile                    --------------db2inst1路径要使用实际环境中的相关实例名代替
fi



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20802110/viewspace-1183722/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-07-11

  • 博文量
    74
  • 访问量
    506083