--缺省数据库路径
C:\>db2 get dbm cfg | find /i "DFTDBPATH"
缺省数据库路径 (DFTDBPATH) = F:
--列出数据库所在驱动器
C:\>db2 list db directory
--列举F盘所有库
C:\>db2 list db directory on f:
--连接数据库
C:\>db2 connect to sample
--查看表空间
C:\>db2 list tablespaces 【show detail】
--取得表空间快照
C:\>db2 get snapshot for tablespaces on sample | more
--列出Tablespace ID为0 的容器
C:\>db2 LIST TABLESPACE CONTAINERS FOR 0
附件
1)表空间特定于页大小的限制
表空间类型
4KB
8KB
16KB
32KB
SMS表空间
64GB
128GB
256GB
512GB
DMS表空间(常规)
64GB
128GB
256GB
512GB
DMS表空间(大型)
2TB
4TB
8TB
16TB
自动存储器表空间(常规)
64GB
128GB
256GB
512GB
自动存储器表空间(大型)
2TB
4TB
8TB
16TB
临时表空间
64GB
128GB
256GB
512GB
2)表空间状态
- 0x0 Normal
- 0x1 Quiesced:SHARE
- 0x2 Quiesced:UPDATE
- 0x4 Quiesced:EXCLUSIVE
- 0x8 Load pending
- 0x10 Delete pending
- 0x20 Backup pending
- 0x40 Rollforward in progress
- 0x80 Rollforward pending
- 0x100 Restore pending
- 0x100 Recovery pending(not used)
- 0x200 Disable pending
- 0x400 Reorg in progress
- 0x800 Backup in progress
- 0x1000 Storage must be defined
- 0x2000 Restore in progress
- 0x4000 Offline and not accessible
- 0x8000 Drop pending
- 0x2000000 Storage may be defined
- 0x4000000 StorDef is in 'final' state
- 0x8000000 StorDef was changed prior to rollforward
- 0x10000000 DMS rebalancer is active
- 0x20000000 TBS deletion in progress
- 0x40000000 TBS creation in progress
- 0x8 For service use only
3)查看表信息
可以使用表所示的命令来获取表信息。
用来获取表信息的命令
命 令 | 描 述 |
list tables | 列出用于当前用户的表 |
list tables for all | 列出数据库中定义的所有表 |
list tables for schema schemaname | 列出指定模式中的表 |
(续表)
命 令 | 描 述 |
list tables for schema | 列出以当前用户名为模式的表 |
describe table tablename | 显示指定的表的结构 |