我有一个具有 master 架构的 db2 数据库 testDb1,第二个是具有 master 架构的 testDb2。
现在我的问题是如何将 testDb1 的主模式表结构复制到 testDb2 主模式..?
最佳答案
db2look正如 @mao 已经提到的,这是你问题的答案。
在源数据库上运行它
db2look -d testDb1 -e -z master -o db2look_testDb2_master.ddl
您将获得一个可运行的脚本,可以轻松应用于目标数据库 - 只需编辑该脚本并更改连接语句中的数据库名称即可。 使用以下命令运行脚本(从命令行)
db2 -tvf db2look_testDb2_master.ddl
关于DB2 : Is there any way to copy one database schema tables structure into another database schema. .?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58080067/