Note
This view is available starting with V4.3.0.
Purpose
The CDB_MVIEW_LOGS view displays information about all materialized view logs.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| LOG_OWNER | varchar(128) | NO | The name of the materialized view log owner. |
| MASTER | varchar(128) | NO | The name of the master table to which the materialized view log belongs. |
| LOG_TABLE | varchar(128) | NO | The name of the materialized view log table. |
| LOG_TRIGGER | varchar(128) | YES | The row-level trigger on the master table that inserts rows into the materialized view log.
NoteThis column is for compatibility only. The default value is NULL. |
| ROWIDS | varchar(3) | NO | Indicates whether to record rowid information.
|
| PRIMARY_KEY | varchar(3) | NO | Indicates whether to record primary key information.
|
| OBJECT_ID | varchar(3) | NO | Indicates whether to record object identifier information in the object table.
NoteThis column is for compatibility only. The default value is NO. |
| FILTER_COLUMNS | varchar(3) | NO | Indicates whether to record filter column information.
|
| SEQUENCE | varchar(3) | NO | Indicates whether to record sequence values that provide additional sorting information.
NoteThe value of this column is always YES. |
| INCLUDE_NEW_VALUES | varchar(3) | NO | Indicates whether to record both the old and new values.
NoteThe value of this column is always YES. |
| PURGE_ASYNCHRONOUS | varchar(3) | NO | Indicates whether the materialized view log is asynchronously purged.
|
| PURGE_DEFERRED | varchar(3) | NO | Indicates whether to purge the materialized view log in a deferred manner.
|
| PURGE_START | datetime | YES | The start date of the deferred purge. |
| PURGE_INTERVAL | varchar(200) | YES | The interval between deferred purges. |
| LAST_PURGE_DATE | datetime | YES | The date when the materialized view log was last purged. |
| LAST_PURGE_STATUS | bigint(1) | NO | The status of the last purge of the materialized view log.
NoteThe value of this column is always 0. |
| NUM_ROWS_PURGED | bigint(20) | YES | The number of rows purged in the last purge of the materialized view log. |
| COMMIT_SCN_BASED | varchar(3) | NO | Indicates whether the materialized view log is based on commit SCN.
NoteThe value of this column is always YES. |
| STAGING_LOG | varchar(3) | NO | Indicates whether the materialized view log is a staging log for synchronous refresh.
NoteThis column is for compatibility only. The default value is NO. |
| PURGE_DOP | bigint(20) | NO | The parallelism for purging the materialized view log.
NoteFor OceanBase Database V4.3.5, this column is available starting from V4.3.5 BP2. |
| LAST_PURGE_TIME | bigint(20) | YES | The duration of the last materialized view log purge task, in seconds.
NoteFor OceanBase Database V4.3.5, this column is available starting from V4.3.5 BP2. |
Sample query
Query all materialized view logs and display the first record.
obclient [(none)]> SELECT * FROM oceanbase.CDB_MVIEW_LOGS LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1
LOG_OWNER: db_test
MASTER: tbl1
LOG_TABLE: mlog$_tbl1
LOG_TRIGGER: NULL
ROWIDS: NO
PRIMARY_KEY: YES
OBJECT_ID: NO
FILTER_COLUMNS: YES
SEQUENCE: YES
INCLUDE_NEW_VALUES: YES
PURGE_ASYNCHRONOUS: NO
PURGE_DEFERRED: YES
PURGE_START: 2025-04-23 15:01:35
PURGE_INTERVAL: sysdate() + interval 1 day
LAST_PURGE_DATE: 2025-04-23 15:01:39
LAST_PURGE_STATUS: 0
NUM_ROWS_PURGED: 0
COMMIT_SCN_BASED: YES
STAGING_LOG: NO
PURGE_DOP: 5
LAST_PURGE_TIME: 0
1 row in set
