且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从远程 Db2 实例连接到 IBM Db2 Event Store 实例?

更新时间:2023-02-24 13:55:16

是的!你实际上非常接近.

Yup! You're actually very close.

假设您已连接到 Db2 Event Store 数据库,您可以运行:

Given you are connected to your Db2 Event Store database, you can run:

db2 列出所有表

或者对于给定的模式:

db2 列出模式的表 <>

现在,由于您使用的是 Db2 11.5 docker 容器,因此您还可以在容器内创建一个数据库.例如:

Now, since you are using Db2 11.5 docker container, you could also create a database inside the container. For example:

db2 create db testdb

之后,您可以连接到容器本地的数据库并列出您的本地"表.例如:

After which you can connect to the database local to the container and list your "local" tables. For example:

> db2 connect to testdb
> db2 list tables for all

这里的关键是您的活跃连接.当创建到远程 Db2 Event Store 数据库时,db2 list tables ... 命令将显示远程数据库的表,当在本地数据库上建立连接时,db2 listtables ... 命令将显示本地数据库的表.

The key thing here is your active connection. When it's made to your remote Db2 Event Store database, the db2 list tables ... command will show tables for the remote database, and when connection is made on the local database, the db2 list tables ... command will show tables for the the local database.