DBA_OB_TABLEGROUPS

2025-11-14 07:33:33  Updated

Note

This view is introduced since OceanBase Database V4.0.0.

Purpose

This view displays metadata about table groups, including information about partitions.

Note

Starting from V4.2.0, the partition attribute field in this view has no meaning and is displayed as NONE or NULL.

Columns

Column Type Nullable? Description
TABLEGROUP_NAME VARCHAR2(128) NO The name of the table group.
PARTITIONING_TYPE VARCHAR2(13) NO The partitioning type of the table group. Valid values include:
  • NONE: a non-partitioned table group.
  • HASH: a hash-partitioned table group (with a single partitioning key).
  • KEY: a key-partitioned table group.
  • RANGE: a range-partitioned table group (with a single partitioning key).
  • RANGE COLUMNS: a range columns-partitioned table group.
  • LIST: a list-partitioned table group (with a single partitioning key).
  • LIST COLUMNS: a list columns-partitioned table group.
  • UNKNOWN: an abnormal type.
  • SUBPARTITIONING_TYPE VARCHAR2(13) NO The subpartitioning type of the table group. Valid values include:
  • NONE: a non-partitioned table group or a table group with a single partitioning key.
  • HASH: a hash-partitioned table group (with a single subpartitioning key).
  • KEY: a key-partitioned table group.
  • RANGE: a range-partitioned table group (with a single subpartitioning key).
  • RANGE COLUMNS: a range columns-partitioned table group.
  • LIST: a list-partitioned table group (with a single subpartitioning key).
  • LIST COLUMNS: a list columns-partitioned table group.
  • UNKNOWN: an abnormal type.
  • PARTITION_COUNT NUMBER NO The value is NULL.
    DEF_SUBPARTITION_COUNT NUMBER NO The value is NULL.
    PARTITIONING_KEY_COUNT NUMBER NO The value is NULL.
    SUBPARTITIONING_KEY_COUNT NUMBER NO The value is NULL.
    SHARDING VARCHAR2(10) NO The SHARDING attribute of the table group. Valid values include:
    • NONE: for a table group with this attribute, all partitions of all tables in the table group are located on the same server, and no restrictions are imposed on tables to be added to the table group.
    • PARTITION: for a table group with this attribute, data of each table in the table group is distributed by primary partitioning key. For a subpartitioned table, all subpartitions under the same primary partition are located on the same server.
    • ADAPTIVE: for a table group with this attribute, data of each table in the table group is distributed by adaptive sharding. That is, if a table in the table group is a primary-partitioned table, its data is distributed by primary partitioning key; if a table in the table group is a subpartitioned table, its data is distributed by subpartitioning key.

    Note

    This field was introduced in V4.2.0.

    Sample query

    1. Create a table group named tblgroup1.

      obclient [SYS]> CREATE TABLEGROUP tblgroup1 SHARDING = 'PARTITION';
      
    2. Query the SHARDING attribute of the TBLGROUP1 table group.

      obclient [SYS]> SELECT TABLEGROUP_NAME, SHARDING FROM SYS.DBA_OB_TABLEGROUPS WHERE tablegroup_name = 'TBLGROUP1';
      

      The query result is as follows:

      +-----------------+-----------+
      | TABLEGROUP_NAME | SHARDING  |
      +-----------------+-----------+
      | TBLGROUP1       | PARTITION |
      +-----------------+-----------+
      1 row in set
      

    References

    Table groups

    Contact Us