Note
This view is introduced in V3.2.1.
Purpose
The ALL_TAB_STATS_HISTORY view provides the table statistics modification history of all tables accessible to the current user.
Applicability
This view applies only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OWNER | VARCHAR2(128) | NO | The owner of the table. |
| TABLE_NAME | VARCHAR2(128) | NO | The name of the table. |
| PARTITION_NAME | VARCHAR2(128) | YES | The name of the partition. |
| SUBPARTITION_NAME | VARCHAR2(128) | YES | The name of the subpartition. |
| STATS_UPDATE_TIME | TIMESTAMP(6) WITH TIME ZONE | YES | The time when the statistics were updated. |
Sample query
Query the table statistics modification history of the T_SUBPART table in all tables that the current user can access.
obclient [SYS]> SELECT * FROM SYS.ALL_TAB_STATS_HISTORY WHERE TABLE_NAME='T_SUBPART';
The query result is as follows:
+-------+------------+----------------+-------------------+-------------------------------------+
| OWNER | TABLE_NAME | PARTITION_NAME | SUBPARTITION_NAME | STATS_UPDATE_TIME |
+-------+------------+----------------+-------------------+-------------------------------------+
| SYS | T_SUBPART | NULL | NULL | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P1 | NULL | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P2 | NULL | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P3 | NULL | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P1 | P1SP0 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P1 | P1SP1 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P1 | P1SP2 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P1 | P1SP3 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P2 | P2SP0 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P2 | P2SP1 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P2 | P2SP2 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P2 | P2SP3 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P3 | P3SP0 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P3 | P3SP1 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P3 | P3SP2 | 21-MAR-25 04.21.31.136013 PM +08:00 |
| SYS | T_SUBPART | P3 | P3SP3 | 21-MAR-25 04.21.31.136013 PM +08:00 |
+-------+------------+----------------+-------------------+-------------------------------------+
16 rows in set
References
DBA_TAB_STATS_HISTORY: view the table statistics modification history of all tables in the current tenant.
USER_TAB_STATS_HISTORY: view the table statistics modification history of all tables owned by the current user.