在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内容就可以了
收起