软件开发数据库using

奇怪的问题,求助!!紧急!!!

aix 5系统
有一个脚本,脚本的内容如下
db2 connect to dbname user name using pass
v_date=`db2 -x "select time from db2inst1.s_time"`
echo $v_date
db2 connect reset



现在的问题是,手工执行脚本sh aa.sh没问题,但是用crontab调度此脚本,$v_date日期输出为空,取不到日期,这是什么问题啊,十分紧急!!!求助大侠们!!!
参与6

5同行回答

qingduo04qingduo04系统架构师华为
学习了........显示全部
学习了........收起
系统集成 · 2011-10-11
浏览465
huangdkhuangdk数据库架构师IBM
脚本里先执行db2profile显示全部
脚本里先执行db2profile收起
IT咨询服务 · 2011-10-10
浏览454
iceswordicesword数据库架构师inspur
恩恩,学习学习显示全部
恩恩,学习学习收起
政府机关 · 2011-10-08
浏览476
richard_shenrichard_shenIT经理US Bank
y need to add db2profile in the beginning of the sh script, so that it can run in cron.显示全部
y need to add db2profile in the beginning of the sh script,
so that it can run in cron.收起
政府机关 · 2011-10-05
浏览471
fyhlovefyhlove数据库管理员上海诺祺科技有限公司
在crontab中运行shell脚本,需要你在shell脚本的开头添加数据库的db2profile信息,比如if [ -f /home/sqllib/db2profile ]; then    . /home/sqllib/db2profilefidb2 connect to dbname user name using passv_date=`db2 -x "select time from db2inst1.s_time"`e...显示全部
在crontab中运行shell脚本,需要你在shell脚本的开头添加数据库的db2profile信息,比如
if [ -f /home/sqllib/db2profile ]; then
    . /home/sqllib/db2profile
fi
db2 connect to dbname user name using pass
v_date=`db2 -x "select time from db2inst1.s_time"`
echo $v_date
db2 connect reset
这个shell内容就可以了收起
IT分销/经销 · 2011-10-05
浏览489

提问者

daijiangbo
项目经理山东众阳软件有限公司
擅长领域: AIX服务器Unix

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2011-10-05
  • 关注会员:1 人
  • 问题浏览:3760
  • 最近回答:2011-10-11
  • X社区推广