查询所有库表:db2 list tables
查询指定schema下的库表:db2 list tables for schema 指定schema
查询当前schema下所有表和表的记录数:select tabname,card from syscat.tables where tabschema = ‘指定schema’
导出指定schema表结构:db2look -d 数据库名 -e -z 指定schema -x -i 用户名 -w 密码 -o 目录/test.sql
创建schema:create schema test
导出单表数据:db2 “export to 目录/test.ixf of IXF select * from user.表名 fetch first 1 rows only”
导入单表数据:db2 “load from test.ixf of ixf savecount 10000 replace info 指定schema.表名”
查询表字段结构:select * from syscat.columns where tabschema = ‘ib’
库表增加或删除字段,要对库表reorg
call sysproc.admin_cmd (‘reorg table schema名.表名’)
07-17