ITPub博客

首页 > 数据库 > 数据库开发技术 > DB2导出给定表

DB2导出给定表

原创 数据库开发技术 作者:fjzcau 时间:2015-03-28 18:20:53 0 删除 编辑
#--循环导表 
i_dbname=testdb
set -A I_EXP db2inst1.t1 s1.t1 

i_time=`date +%Y%m%d%H%M`
i_expdir=/db2/export 

cd $i_expdir
db2 connect to $i_dbname

for i_tab in ${I_EXP[*]} 
do
  db2 "export to ${i_tab}_${i_time}.ixf of ixf 
    lobs to $i_expdir lobfile ${i_tab}_${i_time}.lob modified by lobsinfile 
    messages  ${i_tab}_${i_time}.msg 
    select * from  ${i_tab} "  
done

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

上一篇: mbdb1_backup.sh
请登录后发表评论 登录
全部评论

注册时间:2011-04-03

  • 博文量
    208
  • 访问量
    547145