我写了一个BAT,是用来导出DB2服务器的数据,BAT如下:
db2cmd
db2
connect to DWDB user db2inst1 using 888888
export to D:\sqlldr\data\20091207\fhdgckfhz.del of del select * from BRAS.FHDGCKFHZ
export to D:\sqlldr\data\20091207\fhdgckmxz.del of del select * from BRAS.FHDGCKMXZ
export to D:\sqlldr\data\20091207\fhdkfhz.del of del select * from BRAS.FHDKFHZ
export to D:\sqlldr\data\20091207\fhdkmxz.del of del select * from BRAS.FHDKMXZ
export to D:\sqlldr\data\20091207\fhdsdqfhz.del of del select * from BRAS.FHDSDQFHZ
export to D:\sqlldr\data\20091207\fhdsdqmxz.del of del select * from BRAS.FHDSDQMXZ
export to D:\sqlldr\data\20091207\fhdshqfhz.del of del select * from BRAS.FHDSHQFHZ
export to D:\sqlldr\data\20091207\fhdshqmxz.del of del select * from BRAS.FHDSHQMXZ
export to D:\sqlldr\data\20091207\fhgjfhz.del of del select * from BRAS.FHGJFHZ
export to D:\sqlldr\data\20091207\fhgjmxz.del of del select * from BRAS.FHGJMXZ
export to D:\sqlldr\data\20091207\fhnbz.del of del select * from BRAS.FHNBZ
export to D:\sqlldr\data\20091207\fhnbzmxz.del of del select * from BRAS.FHNBZMXZ
connect reset
一运行,就发现不停的有新窗口打开,这是怎么回事啊,还有一个问题就是,BAT如何取得当天的日期呢,谢谢了
------解决方案--------------------------------------------------------
BAT如何取得当天的日期呢
echo %date:~0,10%
------解决方案--------------------------------------------------------
db2 "export to btpoper.txt of del select * from btpoper"
这样试试
------解决方案--------------------------------------------------------
你只留下一个导入的sql试一下,看是什么情况。
------解决方案--------------------------------------------------------
db2cmd -i -w
加上这两个参数看看。
或者把
db2
connect to DWDB user db2inst1 using 888888
export to D:\sqlldr\data\20091207\fhdgckfhz.del of del select * from BRAS.FHDGCKFHZ
export to D:\sqlldr\data\20091207\fhdgckmxz.del of del select * from BRAS.FHDGCKMXZ
export to D:\sqlldr\data\20091207\fhdkfhz.del of del select * from BRAS.FHDKFHZ
export to D:\sqlldr\data\20091207\fhdkmxz.del of del select * from BRAS.FHDKMXZ
export to D:\sqlldr\data\20091207\fhdsdqfhz.del of del select * from BRAS.FHDSDQFHZ
export to D:\sqlldr\data\20091207\fhdsdqmxz.del of del select * from BRAS.FHDSDQMXZ
export to D:\sqlldr\data\20091207\fhdshqfhz.del of del select * from BRAS.FHDSHQFHZ
export to D:\sqlldr\data\20091207\fhdshqmxz.del of del select * from BRAS.FHDSHQMXZ
export to D:\sqlldr\data\20091207\fhgjfhz.del of del select * from BRAS.FHGJFHZ
export to D:\sqlldr\data\20091207\fhgjmxz.del of del select * from BRAS.FHGJMXZ
export to D:\sqlldr\data\20091207\fhnbz.del of del select * from BRAS.FHNBZ
export to D:\sqlldr\data\20091207\fhnbzmxz.del of del select * from BRAS.FHNBZMXZ
connect reset
写成一个bat
然后
db2cmd -i < XXX.bat执行看看。