Purpose
The oceanbase.CDB_TABLES view displays the information about tables in all tenants.
Note
This view was introduced in OceanBase Database V4.0.0.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CON_ID | bigint(20) | NO | The ID of the tenant. |
| OWNER | varchar(128) | NO | The owner of the table. |
| TABLE_NAME | varchar(128) | NO | The name of the table. |
| TABLESPACE_NAME | varchar(30) | NO | The name of the tablespace that contains the table. |
| CLUSTER_NAME | varchar(128) | NO | At present, this column is not supported and its value is NULL by default. |
| IOT_NAME | varchar(128) | NO | At present, this column is not supported and its value is NULL by default. |
| STATUS | varchar(8) | NO | The status of the table. Valid values: |
| PCT_FREE | bigint(20) | NO | The minimum percentage of free space in a block. |
| PCT_USED | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| INI_TRANS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| MAX_TRANS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| INITIAL_EXTENT | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| NEXT_EXTENT | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| MIN_EXTENTS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| MAX_EXTENTS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| PCT_INCREASE | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| FREELISTS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| FREELIST_GROUPS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| LOGGING | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| BACKED_UP | varchar(1) | NO | At present, this column is not supported and its value is NULL by default. |
| NUM_ROWS | bigint(21) | NO | The number rows in the table. |
| BLOCKS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| EMPTY_BLOCKS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| AVG_SPACE | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| CHAIN_CNT | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| AVG_ROW_LEN | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| AVG_SPACE_FREELIST_BLOCKS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| NUM_FREELIST_BLOCKS | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| DEGREE | varchar(10) | NO | At present, this column is not supported and its value is NULL by default. |
| INSTANCES | varchar(10) | NO | At present, this column is not supported and its value is NULL by default. |
| CACHE | varchar(5) | NO | At present, this column is not supported and its value is NULL by default. |
| TABLE_LOCK | varchar(8) | NO | At present, this column is not supported and its value is NULL by default. |
| SAMPLE_SIZE | bigint(0) | NO | At present, this column is not supported and its value is NULL by default. |
| LAST_ANALYZED | date | NO | At present, this column is not supported and its value is NULL by default. |
| PARTITIONED | varchar(3) | NO | Indicates whether the table is partitioned. Valid values: |
| IOT_TYPE | varchar(12) | NO | At present, this column is not supported and its value is NULL by default. |
| TEMPORARY | varchar(1) | NO | Indicates whether the table is a temporary table. |
| SECONDARY | varchar(1) | NO | At present, this column is not supported and its value is NULL by default. |
| NESTED | varchar(3) | NO | Indicates whether the table is a nested table. Valid values: |
| BUFFER_POOL | varchar(7) | NO | At present, this column is not supported and its value is NULL by default. |
| FLASH_CACHE | varchar(7) | NO | At present, this column is not supported and its value is NULL by default. |
| CELL_FLASH_CACHE | varchar(7) | NO | At present, this column is not supported and its value is NULL by default. |
| ROW_MOVEMENT | varchar(8) | NO | At present, this column is not supported and its value is NULL by default.
NoteFor OceanBase Database V4.2.5, this column takes effect in BP2 of V4.2.5. |
| GLOBAL_STATS | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| USER_STATS | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| DURATION | varchar(15) | NO | The duration of the table if it is a temporary table. |
| SKIP_CORRUPT | varchar(8) | NO | At present, this column is not supported and its value is NULL by default. |
| MONITORING | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| CLUSTER_OWNER | varchar(128) | NO | At present, this column is not supported and its value is NULL by default. |
| DEPENDENCIES | varchar(8) | NO | At present, this column is not supported and its value is NULL by default. |
| COMPRESSION | varchar(8) | NO | At present, this column is not supported and its value is NULL by default. |
| COMPRESS_FOR | varchar(30) | NO | At present, this column is not supported and its value is NULL by default. |
| DROPPED | varchar(3) | NO | Indicates whether the table has been dropped and moved to the recycle bin. |
| READ_ONLY | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| SEGMENT_CREATED | varchar(3) | NO | At present, this column is not supported and its value is NULL by default. |
| RESULT_CACHE | varchar(7) | NO | At present, this column is not supported and its value is NULL by default. |
| CLUSTERING | varchar(3) | NO | At present, the value of this column is NULL by default. |
| ACTIVITY_TRACKING | varchar(23) | NO | At present, the value of this column is NULL by default. |
| DML_TIMESTAMP | varchar(25) | NO | At present, the value of this column is NULL by default. |
| HAS_IDENTITY | varchar(3) | NO | At present, the value of this column is NULL by default. |
| CONTAINER_DATA | varchar(3) | NO | At present, the value of this column is NULL by default. |
| INMEMORY | varchar(8) | NO | At present, the value of this column is NULL by default. |
| INMEMORY_PRIORITY | varchar(8) | NO | At present, the value of this column is NULL by default. |
| INMEMORY_DISTRIBUTE | varchar(15) | NO | At present, the value of this column is NULL by default. |
| INMEMORY_COMPRESSION | varchar(17) | NO | At present, the value of this column is NULL by default. |
| INMEMORY_DUPLICATE | varchar(13) | NO | At present, the value of this column is NULL by default. |
| DEFAULT_COLLATION | varchar(100) | NO | At present, the value of this column is NULL by default. |
| DUPLICATED | varchar(1) | NO | At present, the value of this column is NULL by default. |
| SHARDED | varchar(1) | NO | At present, the value of this column is NULL by default. |
| EXTERNALLY_SHARDED | varchar(1) | NO | At present, the value of this column is NULL by default. |
| EXTERNALLY_DUPLICATED | varchar(1) | NO | At present, the value of this column is NULL by default. |
| EXTERNAL | varchar(3) | NO | Indicates whether the table is an external table. Valid values: |
| HYBRID | varchar(3) | NO | At present, the value of this column is NULL by default. |
| CELLMEMORY | varchar(24) | NO | At present, the value of this column is NULL by default. |
| CONTAINERS_DEFAULT | varchar(3) | NO | At present, the value of this column is NULL by default. |
| CONTAINER_MAP | varchar(3) | NO | At present, the value of this column is NULL by default. |
| EXTENDED_DATA_LINK | varchar(3) | NO | At present, the value of this column is NULL by default. |
| EXTENDED_DATA_LINK_MAP | varchar(3) | NO | At present, the value of this column is NULL by default. |
| INMEMORY_SERVICE | varchar(12) | NO | At present, the value of this column is NULL by default. |
| INMEMORY_SERVICE_NAME | varchar(1000) | NO | At present, the value of this column is NULL by default. |
| CONTAINER_MAP_OBJECT | varchar(3) | NO | At present, the value of this column is NULL by default. |
| MEMOPTIMIZE_READ | varchar(8) | NO | At present, the value of this column is NULL by default. |
| MEMOPTIMIZE_WRITE | varchar(8) | NO | For internal use only. |
| HAS_SENSITIVE_COLUMN | varchar(3) | NO | At present, the value of this column is NULL by default. |
| ADMIT_NULL | varchar(3) | NO | At present, the value of this column is NULL by default. |
| DATA_LINK_DML_ENABLED | varchar(3) | NO | At present, the value of this column is NULL by default. |
| LOGICAL_REPLICATION | varchar(8) | NO | At present, the value of this column is NULL by default. |
Sample query
In the sys tenant, query the information about table tbl1 in the tenant with ID 1002.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_TABLES WHERE CON_ID=1002 AND TABLE_NAME = 'tbl1'\G
The query result is as follows:
*************************** 1. row ***************************
CON_ID: 1002
OWNER: infotest
TABLE_NAME: tbl1
TABLESPACE_NAME: NULL
CLUSTER_NAME: NULL
IOT_NAME: NULL
STATUS: VALID
PCT_FREE: 0
PCT_USED: NULL
INI_TRANS: NULL
MAX_TRANS: NULL
INITIAL_EXTENT: NULL
NEXT_EXTENT: NULL
MIN_EXTENTS: NULL
MAX_EXTENTS: NULL
PCT_INCREASE: NULL
FREELISTS: NULL
FREELIST_GROUPS: NULL
LOGGING: NULL
BACKED_UP: NULL
NUM_ROWS: NULL
BLOCKS: NULL
EMPTY_BLOCKS: NULL
AVG_SPACE: NULL
CHAIN_CNT: NULL
AVG_ROW_LEN: NULL
AVG_SPACE_FREELIST_BLOCKS: NULL
NUM_FREELIST_BLOCKS: NULL
DEGREE: NULL
INSTANCES: NULL
CACHE: NULL
TABLE_LOCK: NULL
SAMPLE_SIZE: NULL
LAST_ANALYZED: NULL
PARTITIONED: NO
IOT_TYPE: NULL
TEMPORARY: N
SECONDARY: NULL
NESTED: NO
BUFFER_POOL: NULL
FLASH_CACHE: NULL
CELL_FLASH_CACHE: NULL
ROW_MOVEMENT: NO
GLOBAL_STATS: NULL
USER_STATS: NULL
DURATION: NULL
SKIP_CORRUPT: NULL
MONITORING: NULL
CLUSTER_OWNER: NULL
DEPENDENCIES: NULL
COMPRESSION: NULL
COMPRESS_FOR: NULL
DROPPED: NO
READ_ONLY: NULL
SEGMENT_CREATED: NULL
RESULT_CACHE: NULL
CLUSTERING: NULL
ACTIVITY_TRACKING: NULL
DML_TIMESTAMP: NULL
HAS_IDENTITY: NULL
CONTAINER_DATA: NULL
INMEMORY: NULL
INMEMORY_PRIORITY: NULL
INMEMORY_DISTRIBUTE: NULL
INMEMORY_COMPRESSION: NULL
INMEMORY_DUPLICATE: NULL
DEFAULT_COLLATION: NULL
DUPLICATED: NULL
SHARDED: NULL
EXTERNALLY_SHARDED: NULL
EXTERNALLY_DUPLICATED: NULL
EXTERNAL: NO
HYBRID: NULL
CELLMEMORY: NULL
CONTAINERS_DEFAULT: NULL
CONTAINER_MAP: NULL
EXTENDED_DATA_LINK: NULL
EXTENDED_DATA_LINK_MAP: NULL
INMEMORY_SERVICE: NULL
INMEMORY_SERVICE_NAME: NULL
CONTAINER_MAP_OBJECT: NULL
MEMOPTIMIZE_READ: NULL
MEMOPTIMIZE_WRITE: NULL
HAS_SENSITIVE_COLUMN: NULL
ADMIT_NULL: NULL
DATA_LINK_DML_ENABLED: NULL
LOGICAL_REPLICATION: NULL
1 row in set