【发布时间】:2020-07-18 03:36:19
【问题描述】:
我正在尝试使用SchemaCrawler 来提取关于 db2 测试数据库的架构信息。
以文本或 html 格式运行 schema 命令时,一切正常:
./schemacrawler.sh --server=db2 --host=127.0.0.1 --port=50000 --database=sample --schemas=DB2INST1 --user="db2inst1" --password=password --info-level=standard --command=schema --tables='.*\.P.*'
System Information
========================================================================
generated by SchemaCrawler 16.9.2
generated on 2020-07-17 01:50:58.987909
Tables
========================================================================
DB2INST1.PRODUCT [table]
------------------------------------------------------------------------
PID VARCHAR(10) NOT NULL
NAME VARCHAR(128)
PRICE DECIMAL(30, 2)
PROMOPRICE DECIMAL(30, 2)
PROMOSTART DATE
PROMOEND DATE
DESCRIPTION XML
Primary Key
PK_PRODUCT [primary key]
PID
Indexes
PK_PRODUCT [unique index]
PID ascending
(... and so on ...)
现在我想以 JSON 格式输出它以进行数据集成。所以我尝试运行schema命令,输出为json格式,但失败了(full log here):
SchemaCrawler 16.9.2
Error: Unknown command <schema>
Re-run SchemaCrawler with just the
-h
option for help
Or, re-run SchemaCrawler with an additional
--log-level=CONFIG
option for details on the error
我也试过the command serialize,也失败了(full log here):
SchemaCrawler 16.9.2
Error: Unknown command <serialize>
Re-run SchemaCrawler with just the
-h
option for help
Or, re-run SchemaCrawler with an additional
--log-level=CONFIG
option for details on the error
顺便说一句,在 Oracle 服务器上运行时,我也遇到了类似的问题。
那么,两个问题:
- 如何从 db2 服务器中提取 JSON 格式的模式信息?
- 如何为 Oracle 服务器做同样的事情?
谢谢。
【问题讨论】:
标签: oracle db2 schemacrawler