现在的位置: 首页 > 综合 > 正文

shell && sql 交互脚本

2014年02月13日 ⁄ 综合 ⁄ 共 201字 ⁄ 字号 评论关闭

shell中调用sqlplus
sqlplus -s user/pwd@datebase<<EOF>/dev/null
spool b.txt
select * from a;
spool off
exit
EOF
cat b.txt|tr -d ''>b.txt

shell中调用dbtool
/dxyyt/kefu/dbtool cxtyd_rw/tyd4321@gdsm2 -f[$sqldir] afljk 1>/dev/null 2>&1 

抱歉!评论已关闭.