db2命令-数据库路径查找命令

--缺省数据库路径 
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)表空间状态

 

  1. 0x0              Normal  
  2. 0x1              Quiesced:SHARE  
  3. 0x2              Quiesced:UPDATE 
  4. 0x4              Quiesced:EXCLUSIVE  
  5. 0x8              Load pending  
  6. 0x10             Delete pending  
  7. 0x20             Backup pending  
  8. 0x40             Rollforward in progress  
  9. 0x80             Rollforward pending  
  10. 0x100            Restore pending  
  11. 0x100            Recovery pending(not used)  
  12. 0x200            Disable pending  
  13. 0x400            Reorg in progress  
  14. 0x800            Backup in progress  
  15. 0x1000           Storage must be defined  
  16. 0x2000           Restore in progress  
  17. 0x4000           Offline and not accessible  
  18. 0x8000           Drop pending  
  19. 0x2000000        Storage may be defined  
  20. 0x4000000        StorDef is in 'final' state  
  21. 0x8000000        StorDef was changed prior to rollforward  
  22. 0x10000000       DMS rebalancer is active  
  23. 0x20000000       TBS deletion in progress  
  24. 0x40000000       TBS creation in progress  
  25. 0x8              For service use only 

 

3)查看表信息

可以使用表所示的命令来获取表信息。

 用来获取表信息的命令

   

   

list tables

列出用于当前用户的表

list tables for all

列出数据库中定义的所有表

list tables for schema schemaname

列出指定模式中的表

(续表)

   

   

list tables for schema

列出以当前用户名为模式的表

describe table tablename

显示指定的表的结构

 

 


                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值