需要使用unix shell脚本连接到DB2数据库我每次都使用QMF工具来运行DB2查询。现在我需要通过shell脚本连接它。DSN名称--GM2P数据库名称-- DPPRICMG表名--项目任何帮助和建议都将不胜感激。有人能尽快回答这个问题吗?谢谢
发布于 2012-10-19 18:54:34
为了正确运行脚本,您必须对远程数据库进行编目,如下所示:
db2 catalog tcpip node NODE1 remote ip.ip.ip.ip server 50000
db2 catalog database mydb1 at node NODE1 authentication server然后,您可以使用此脚本发出所需的任何sql:
db2 connect to mydb2 user username using password
db2 "update bla bla bla "
db2 connect reset请注意,如果您使用的是z/OS的DB2,那么编目将略有不同。
https://stackoverflow.com/questions/11399333
复制相似问题