oncheck -pt 和 -pT:显示表或分片的 tblspaces

oncheck -ptoncheck -pT 选项打印指定表或分片的 tblspace 报告。它们之间的仅有一个区别:oncheck -pT 打印更多的信息,包括一些特定索引的信息。

语法
表 1. oncheck -pt 和 oncheck -pT 命令的选项
元素 用途 关键注意事项
database 指定要检查其一致性的数据库名称 语法必须符合 Identifier 段;请参阅 GBase 8s SQL 语法指南
frag_dbs 指定包含想要检查其一致性的分片的 dbspace 名称 Dbspace 必须存在并包含要检查一致性的分片。

语法必须符合 Identifier 段;请参阅 Identifier

owner 指定表的所有者 必须指定表的当前所有者。

语法必须符合 Owner Name 段;请参阅 Owner name

table 指定想要检查其一致性的表的名称 表应存在。

语法必须符合 Table Name 段;请参阅 GBase 8s SQL 语法指南

-pt 选项打印给定分片和数据库的 tblspace 报告。如果未指定表,该选项显示数据库中所有表的信息。该报告包含一般的分配信息,包括最大行大小、键数量、extent 数量、其大小、每个 extent 所分配和使用的页、当前的序列值以及表的创建日期。-pt 输出打印了 tblspace 页大小、逻辑页的页数(分配的页、使用的页和数据页)。

TBLspace Flags 字段显示了 tblspace 的配置信息,包括该 tblspace 是用于 Enterprise Replication 还是时间序列数据。

Extents 字段列出了该表中 tblspace tblspace 条目的物理地址和第一个 extent 的首页地址。该 extent 列表显示了每个事件中的逻辑页号和物理页号。

-pT 选项打印与 -pt 选项相同的信息。此外,-pT 选项还显示以下信息:

当您想要运行选项时请做出计划,因为它要完整扫描一个分区。

-pt-pT 的输出包含已使用页数的列表。输出中显示的该字段的值绝不会减小,因为作为 extent 的一部分分配给 tblspace 的磁盘空间仍保持专用于该 extent,即使在通过删除行而释放空间之后也是如此。有关当前使用页数的准确计数,请参阅 -pT 选项提供的有关 tblspace 使用情况(按页类型组织)的详细信息。

oncheck -pt 输出样本

以下示例显示了 oncheck -pt 命令输出的样本:
TBLspace Report for testdb:tab1
          
          Physical Address               2:10
          Creation date                  10/07/2004 17:01:16
          TBLspace Flags                 801        Page Locking
          TBLspace use 4 bit bit-maps
          Maximum row size               14        
          Number of special columns      0         
          Number of keys                 0         
          Number of extents              1         
          Current serial value           1         
          Pagesize (k)                   4         
          First extent size              4         
          Next extent size               4         
          Number of pages allocated      340       
          Number of pages used           337       
          Number of data pages           336       
          Number of rows                 75806     
          Partition partnum              2097154   
          Partition lockid               2097154   
          
          Extents                       
          Logical Page     Physical Page        Size Physical Pages
          0             2:106         340        680

oncheck -pT 输出示例

以下示例显示了oncheck -pT 命令的输出:

TBLspace Report for database_a:nilesh.table_1a
        
        Table fragment partition dbspace1 in DBspace dbspace1
        
        Physical Address               3:5
        Creation date                  03/21/2009 15:35:47
        TBLspace Flags                 8000901    Page Locking
        TBLspace contains VARCHARS
        TBLspace use 4 bit bit-maps
        TBLspace is compressed
        Maximum row size               80
        Number of special columns      1
        Number of keys                 0
        Number of extents              1
        Current serial value           100001
        Current SERIAL8 value          1
        Current BIGSERIAL value        1
        Current REFID value            1
        Pagesize (k)                   2
        First extent size              8
        Next extent size               8
        Number of pages allocated      24
        Number of pages used           22
        Number of data pages           14
        Number of rows                 500
        Partition partnum              3145730
        Partition lockid               3145730
        
        Extents
        Logical Page     Physical Page        Size Physical Pages
        0           3:16053          24         24
        
        Type                  Pages      Empty  Semi-Full       Full  Very-Full
        ---------------- ---------- ---------- ---------- ---------- ----------
        Free                      9
        Bit-Map                   1
        Index                     0
        Data (Home)              14
        Data (Remainder)          0          0          0          0          0
        ----------
        Total Pages              24
        
        Unused Space Summary
        
        Unused data bytes in Home pages                1177
        Unused data bytes in Remainder pages              0
        
        Home Data Page Version Summary
        
        Version                                 Count
        
        0 (current)                         14
        
        Compressed Data Summary
        
        Number of compressed rows and percentage of compressed rows  500 100.00