Overview
The CDB_MVIEW_LOGS view displays information about all materialized view logs.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| LOG_OWNER | varchar(128) | NO | Owner name of the materialized view log |
| MASTER | varchar(128) | NO | The name of the primary table to which the materialized view log belongs. |
| LOG_TABLE | varchar(128) | NO | Materialized View Log Table Name |
| LOG_TRIGGER | varchar(128) | YES | A trigger that fires after a row is inserted into the primary table, used to insert the row into the materialized view log.
NoteThis field is only compatible with and its default value is NULL. |
| ROWIDS | varchar(3) | NO | Specifies whether to record the rowid information.
|
| PRIMARY_KEY | varchar(3) | NO | Whether to record the primary key information.
|
| OBJECT_ID | varchar(3) | NO | Indicates whether object identification information is recorded in the object table.
NoteThis field is only compatible with the value NO by default. |
| FILTER_COLUMNS | varchar(3) | NO | Whether to record filtered column information.
|
| SEQUENCE | varchar(3) | NO | Specifies whether to record the sequence value that provides additional sorting information.
NoteThe value of this field is always YES. |
| INCLUDE_NEW_VALUES | varchar(3) | NO | Specifies whether to record both the old and new values.
NoteThe value of this field is always YES. |
| PURGE_ASYNCHRONOUS | varchar(3) | NO | Whether the materialized view log is cleared asynchronously.
|
| PURGE_DEFERRED | varchar(3) | NO | Specifies whether to purge materialized view logs in a delayed manner.
|
| PURGE_START | datetime | YES | Delayed cleanup start date |
| PURGE_INTERVAL | varchar(200) | YES | Indicates the clearance time interval for delayed clearance. |
| LAST_PURGE_DATE | datetime | YES | Date of the last purge of materialized view logs |
| LAST_PURGE_STATUS | bigint(1) | NO | Indicates the status of the last materialized view log purge.
NoteThe value of this field is always 0. |
| NUM_ROWS_PURGED | bigint(20) | YES | Indicates the number of rows cleared in the last materialized view log cleanup. |
| COMMIT_SCN_BASED | varchar(3) | NO | Whether the materialized view log is based on the commit SCN.
NoteThe value of this field is always YES. |
| STAGING_LOG | varchar(3) | NO | Whether the materialized view log is a temporary log for synchronous refresh.
NoteThis field is only compatible with and its default value is NO. |
| PURGE_DOP | bigint(20) | NO | The degree of parallelism for cleaning up materialized view logs. |
| LAST_PURGE_TIME | bigint(20) | YES | The time consumed by the last materialized view log cleanup task, in seconds. |
| LAST_PURGE_METHOD | varchar(16) | NO | The method used in the last materialized view log cleanup task. Valid values:
|
Sample query
Query all materialized view log information 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
LAST_PURGE_METHOD: NULL
1 row in set