如何使用CL工具连接远程db2数据库?
如何使用 util db2advis 或类似工具连接到远程 db2 数据库?我可以使用 jdbc:db2://ip:port/dbname 连接。应如何根据 Db2 命令行工具将其转换为数据库名称“db2advis -d database_name”?
How to connect to remote db2 database with util db2advis or similar? I can connect with jdbc:db2://ip:port/dbname. How this should be converted in terms of Db2 commandline tools to db name "db2advis -d database_name"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DB2 实用程序(例如 db2look、db2expln 和 db2advis)需要本地 DB2 节点目录中的远程实例条目以及本地 DB2 数据库目录中的远程数据库条目。与此相关的命令是 db2“LIST NODE DIRECTORY”、db2“LIST DB DIRECTORY”、db2“CATALOG NODE”(或“CATALOG TCPIP NODE”)和 db2“CATALOG DATABASE”。如果这些命令不起作用,您可能没有安装完整的 DB2 客户端,因为 JDBC 连接只能与几个 JAR 文件进行连接。如果在整个本地服务器上找不到 db2ilist 命令,那么您肯定没有安装完整的 DB2 客户端。如果 db2ilist 存在,但运行它没有产生任何结果,则尚未创建客户端实例。否则,您需要获取位于 DB2 客户端实例所有者主目录正下方的 ./sqllib/db2profile 脚本。
DB2 utilities such as db2look, db2expln, and db2advis require an entry for the remote instance in the local DB2 node directory, and an entry for the remote database in the local DB2 database directory. The commands involved with this are db2 "LIST NODE DIRECTORY", db2 "LIST DB DIRECTORY", db2 "CATALOG NODE" (or "CATALOG TCPIP NODE"), and db2 "CATALOG DATABASE". If those commands do not work, you may not have a full DB2 client installed, since JDBC connections can connect with only a couple of JAR files. If the db2ilist command cannot be found on the entire local server, you definitely don't have a full DB2 client installed. If db2ilist is there, but running it produces no results, then a client instance hasn't been created yet. Otherwise, you'll need to source the the ./sqllib/db2profile script located immediately beneath the home directory of the DB2 client instance owner.