在DB2中显示表的定义 [英] In DB2 Display a table's definition

查看:121
本文介绍了在DB2中显示表的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在学习DB2,并想知道如何
在创建一个表后查看表的特征。



类似于EXPLAIN TABLE命令在MySQL中。



谢谢。

解决方案

除了DESCRIBE TABLE,你可以使用下面的

  DESCRIBE INDEXES FOR TABLE * tablename * SHOW DETAIL 

获取有关表索引的信息。



有关表格的最全面的详细信息DB2 for Linux,UNIX和Windows可以从db2look实用程序获取,您可以从远程客户端或直接在DB2服务器上作为本地用户运行。该工具生成DDL和模拟表及其统计数据所需的其他信息。 DB2 9.5中db2look的文档是这里



以下 db2look 命令将连接到SALESDB数据库,并获取重新创建ORDERS表所需的DDL命令

  db2look -d SALESDB -e -t ORDERS 


Hello everybody I am learning DB2 and would like to know how to see a table's characteristics after I create one.

Similar to the EXPLAIN TABLE command in MySQL.

Thank you.

解决方案

In addition to DESCRIBE TABLE, you can use the below

DESCRIBE INDEXES FOR TABLE *tablename* SHOW DETAIL 

to get information about the table's indexes.

The most comprehensive detail about a table on DB2 for Linux, UNIX, and Windows can be obtained from the db2look utility, which you can run from a remote client or directly on the DB2 server as a local user. The tool produces the DDL and other information necessary to mimic tables and their statistical data. The docs for db2look in DB2 9.5 are here.

The following db2look command will connect to the SALESDB database and obtain the DDL commands necessary to recreate the ORDERS table

db2look -d SALESDB -e -t ORDERS

这篇关于在DB2中显示表的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆