Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The oceanbase.DBA_TAB_MODIFICATIONS view displays the modification history of all tables of the database since the table statistics were collected the last time.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TABLE_OWNER | varchar(128) | NO | The database to which the modified table belongs. |
| TABLE_NAME | varchar(128) | NO | The name of the modified table. |
| PARTITION_NAME | varchar(128) | NO | The name of the modified partition. |
| SUBPARTITION_NAME | varchar(128) | NO | The name of the modified subpartition. |
| INSERTS | bigint(20) | NO | The approximate number of insertions since the last statistic collection operation. |
| UPDATES | bigint(20) | NO | The approximate number of updates since the last statistic collection operation. |
| DELETES | bigint(20) | NO | The approximate number of deletions since the last statistic collection operation. |
| TIMESTAMP | date | NO | The time when the table was last modified. |
| TRUNCATED | varchar(3) | NO | Indicates whether the table has been truncated since the last analysis. Valid values: YESNO |
| DROP_SEGMENTS | bigint(0) | NO | The number of partition and subpartition segments that have been dropped since the last analysis. |
Sample query
Query the modification information of the t_subpart table since the last statistics collection.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_TAB_MODIFICATIONS WHERE TABLE_NAME='t_subpart';
The query result is as follows:
+-------------+---------------+----------------+-------------------+---------+---------+---------+------------+-----------+---------------+
| TABLE_OWNER | TABLE_NAME | PARTITION_NAME | SUBPARTITION_NAME | INSERTS | UPDATES | DELETES | TIMESTAMP | TRUNCATED | DROP_SEGMENTS |
+-------------+---------------+----------------+-------------------+---------+---------+---------+------------+-----------+---------------+
| test | t_subpart | NULL | p2023sp0 | 0 | 0 | 0 | 2025-03-21 | NULL | NULL |
| test | t_subpart | NULL | p2023sp1 | 0 | 0 | 0 | 2025-03-21 | NULL | NULL |
| test | t_subpart | NULL | p2023sp2 | 0 | 0 | 0 | 2025-03-21 | NULL | NULL |
| test | t_subpart | NULL | p2023sp3 | 0 | 0 | 0 | 2025-03-21 | NULL | NULL |
| test | t_subpart | NULL | p2024sp0 | 0 | 0 | 0 | 2025-03-21 | NULL | NULL |
| test | t_subpart | NULL | p2024sp1 | 0 | 0 | 0 | 2025-03-21 | NULL | NULL |
| test | t_subpart | NULL | p2024sp2 | 0 | 0 | 0 | 2025-03-21 | NULL | NULL |
| test | t_subpart | NULL | p2024sp3 | 0 | 0 | 0 | 2025-03-21 | NULL | NULL |
| test | t_subpart | NULL | p_maxsp1 | 1 | 0 | 0 | NULL | NULL | NULL |
+-------------+---------------+----------------+-------------------+---------+---------+---------+------------+-----------+---------------+
9 rows in set