1、列出所有用户表:db2 list tables --要先连接数据库 2、列出所有系统表:db2 list tables for system 3、列出所有表:db2 list tables for all 4、列出用户表:db2 list tables for user 5、列出所有特殊用户表:db2 list tables for schema <user> 导出单表表结构:db2look -d -u <user> -t -e -o...
2. 连接到db2数据库:connect to 数据库名 用户名 使用用户名 3. 显示所有的表:list tables 方法二:使用db2 Control Center工具 1. 打开db2 Control Center工具。 2. 连接到db2数据库。 3. 在左侧的导航栏中,展开数据库并找到对应的数据库。 4. 右键单击数据库,选择“对象”选项。 5. 在右侧的窗口中,选...
20、列出系统表 db2 list tables for system 21、查询列出所有表 db2 list tables for all 22、查看特定用户表 db2 list tables for schema user 23、查询表 db2 "select * from table 表名" 24、查看正在执行的sql db2 list application show detail |grep -i exe 25、看数据库表空间 db2pd -db 数据库...
<1>查询数据库目录: db2 list db directory <2>查询数据库中表 db2 list tables 当前用户 db2 list tables for all 所有表 db2 list tables for schema schemaname 指定模式的表 <3>显示表结构 db2 describe table tablename <4>插入数据 db2 insert into tablename(字段名,字段名...) values (与字段名...
列出特定用户表:db2 list tables for schema <user> 创建相同结构的数据表:db2 create table 新表名 like 原始表名 备份数据表:db2 insert into 导入表 select *from 到出表 查询表信息:db2 select *from 表名 显示表结构:db2 describe table 表名 ...
#db2 list tables for all 16、 列出系统表 #db2 list tables for system 17、列出用户表 #db2 list tables for user 18、 列出特定用户表 #db2 list tables for schema [user] 19、 创建一个与数据库中某个表(t2)结构相同的新表(t1) #db2 create table t1 like t2 ...
7. db2 list tables for all:列出所有数据库中的表。这个命令会列出当前数据库中的所有表的列表。 8. db2 backup databaseto:备份数据库到指定路径。这个命令可以用来进行数据库的备份操作。 9. db2 restore databasefrom:从指定路径恢复数据库。这个命令用于数据库的恢复操作,将数据库从指定路径还原。
可以使用LIST TABLESPACES 命令确定连接数据库中表空间的当前状态,可以使用SHOW DETAIL选项查看表空间的详细信息。 7、 查看表的状态 查询系统目录视图以获得关于数据库的表的状态信息。例如,下面的语句将返回在 SYSCAT.TABLES 中有项的所有表的名称,以及每个表的列数和表的状态(N = 正常;C = 待审核(check pending...
单单是list tables的话,会拿当前连接的用户名作为默认的模式名,输出其视图,表,别名,昵称……如果 for all 的话,所有模式名的 @#$%& 都会输出出来。
一、查询指定模式下的所有表 db2 LIST TABLES FOR SCHEMA 模式名 二、查询当前模式下所有表及信息 db2 select tabname from syscat.tables where tabschema = CURRENT SCHEMA 三、查询当前模式下所有的表 db2 LIST TABLES FOR ALL 四、查询指定表名的表 db2 select * from syscat.tables where TAB...