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 primary 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 primary table that inserts rows into the materialized view log
NoteThis column is compatible only and its value is NULL by default. |
| ROWIDS | varchar(3) | NO | Indicates whether to record the rowid information
|
| PRIMARY_KEY | varchar(3) | NO | Indicates whether to record the primary key information
|
| OBJECT_ID | varchar(3) | NO | Indicates whether to record the object identifier information in the object table
NoteThis column is compatible only and its value is NO by default. |
| FILTER_COLUMNS | varchar(3) | NO | Indicates whether to record the filter column information
|
| SEQUENCE | varchar(3) | NO | Indicates whether to record the sequence value that provides 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 to asynchronously purge the materialized view log
|
| 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 from the materialized view log in the last purge. |
| COMMIT_SCN_BASED | varchar(3) | NO | Indicates whether to base the materialized view log on the 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 compatible only and its value is NO by default. |
| 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 time spent on 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