这个脚本很不错,导出数据时,只是加上表名就行了,其实import或load数据可以参考同样的方式:
#!/usr/bin/sh
db2 connect to weblist="DB2INST1.ACCESS_IDDB2INST1.ACCESS_ID_HISTDB2INST1.APPL_PRIV_CODE_RULE_BLUE_GROUPDB2INST1.CUST_RFC_BATCH_ERRDB2INST1.CUST_DTRMNTN_LOOKUP_HISTDB2INST1.NOTIFIED_USERDB2INST1.NOTIFIED_USER_HISTDB2INST1.SAMETIME_USERSDB2INST1.SAP_IDOC_USER_ID_XREFDB2INST1.SAP_IDOC_USER_ID_XREF_HISTDB2INST1.USER_PRIVDB2INST1.USER_PRIV_HISTDB2INST1.USERSDB2INST1.USERS_HISTDB2INST1.WEB_AUTH_REG"for one in $listdo db2 -v "export to $one.ixf of ixf select * from $one with ur" >>export.logif [ $? -ne 0 ]; then echo "error table: $one">>error.logfidone