【DB2】查看表空间对应的物理文件地址

使用的命令:

db2 list tablespaces show detail

db2 list tablespace containers for [Tablespace ID] [show detail]

说明:在语句末尾添加show detail,则能查看表空间大小以及使用的信息

以下是具体实现案例:

在日常使用db2的过程中,有时候我们需要查询db2表空间所存储的位置来判断磁盘空间是否还够用,下面为查询表空间TEMPTS16K的位置

db2inst1@Linux:/opt> db2 list tablespaces show detail

           Tablespaces for Current Database

Tablespace ID                        = 0
  Name                                 = SYSCATSPACE
  Type                                 = Database managed space
  Contents                             = All permanent data. Regular table space.
  State                                = 0x0000
    Detailed explanation:
      Normal
  Total pages                          = 24576
  Useable pages                        = 24572
  Used pages                           = 22552
  Free pages                           = 2020
  High water mark (pages)              = 22552
  Page size (bytes)                    = 4096
  Extent size (pages)                  = 4
  Prefetch size (pages)                = 4
  Number of containers                 = 1

Tablespace ID                        = 1
  Name                                 = TEMPSPACE1
  Type                                 = System managed space
  Contents                             = System Temporary data
  State                                = 0x0000
    Detailed explanation:
      Normal
  Total pages                          = 1
  Useable pages                        = 1
  Used pages                           = 1
  Free pages                           = Not applicable
  High water mark (pages)              = Not applicable
  Page size (bytes)                    = 4096
  Extent size (pages)                  = 32
  Prefetch size (pages)                = 32
  Number of containers                 = 1

Tablespace ID                        = 2
  Name                                 = USERSPACE1
  Type                                 = Database managed space
  Contents                             = All permanent data. Large table space.
  State                                = 0x0000
    Detailed explanation:
      Normal
  Total pages                          = 49152
  Useable pages                        = 49120
  Used pages                           = 45984
  Free pages                           = 3136
  High water mark (pages)              = 45984
  Page size (bytes)                    = 4096
  Extent size (pages)                  = 32
  Prefetch size (pages)                = 32
  Number of containers                 = 1

Tablespace ID                        = 3
  Name                                 = TEMPTS16K
  Type                                 = System managed space
  Contents                             = System Temporary data
  State                                = 0x0000
    Detailed explanation:
      Normal
  Total pages                          = 1
  Useable pages                        = 1
  Used pages                           = 1
  Free pages                           = Not applicable
  High water mark (pages)              = Not applicable
  Page size (bytes)                    = 16384
  Extent size (pages)                  = 32
  Prefetch size (pages)                = 32
  Number of containers                 = 1

db2inst1@Linux:/opt> db2 list tablespace containers for 3

            Tablespace Containers for Tablespace 3

Container ID                         = 0
  Name                                 = /db2home/db2inst1/db2inst1/NODE0000/QINDB/T0000003/C0000000.TMP
  Type                                 = Path

从上述显示结果我们可以看出,表空间TEMPTS16K对应的物理文件路径为:/db2home/db2inst1/db2inst1/NODE0000/QINDB/T0000003/C0000000.TMP

转载于:https://www.cnblogs.com/OliverQin/p/10207371.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值