DBMS_DATA_DICT is used to control the scheduling of the data dictionary.
Syntax
Disable scheduling of the data dictionary
CALL DBMS_DATA_DICT.DISABLE_DUMP();
Notice
If the dictionary configuration item dump_data_dictionary_to_log_interval is not set to 0, the execution will fail and prompt the user to set this configuration item to 0.
Enable scheduling of the data dictionary
CALL DBMS_DATA_DICT.ENABLE_DUMP();
Manually trigger dictionary generation
CALL DBMS_DATA_DICT.TRIGGER_DUMP(DICT_ITEM_RETENTION_BY_DAY);
Adjust the scheduled DUMP interval for the dictionary
CALL DBMS_DATA_DICT.MODIFY_DUMP_INTERVAL(INTERVAL_EXPR);
Scenarios that trigger dictionary generation scheduling:
After a tenant is created, the data dictionary is automatically generated.
When archiving is enabled, the data dictionary is automatically generated.
Notice
The dictionary DUMP service must be enabled before execution (i.e., execute ALL DBMS_DATA_DICT.ENABLE_DUMP() first), otherwise the execution will fail.
Adjust the retention interval for dictionary history records
CALL DBMS_DATA_DICT.MODIFY_DICT_ITEM_RETENTION(DICT_ITEM_RETENTION_BY_DAY)
Parameters
| Parameter | Description | Data type |
|---|---|---|
| DICT_ITEM_RETENTION_BY_DAY |
|
INT |
| INTERVAL_EXPR | Specifies the desired scheduling interval. This parameter must follow the format of REPEAT_INTERVAL in DBMS_SCHEDULER, and must be enclosed in single quotes. For example, 'FREQ=MINUTELY; INTERVAL=120'. Here's how it works:
INTERVAL_EXPR. |
TEXT |
| DICT_ITEM_RETENTION_BY_DAY | Specifies the desired retention time for dictionary history records, in days. Compared to calling DBMS_DATA_DICT.TRIGGER_DUMP with parameters, this stored procedure will set the default retention time for subsequent dictionary DUMPs to the specified time (unless you manually execute DBMS_DATA_DICT.TRIGGER_DUMP with parameters). |
INT |
Examples
Disable scheduling of the data dictionary
CALL DBMS_DATA_DICT.DISABLE_DUMP();
Query OK, 0 rows affected
Enable scheduling of the data dictionary
CALL DBMS_DATA_DICT.ENABLE_DUMP();
Query OK, 0 rows affected
Manually trigger dictionary generation
CALL DBMS_DATA_DICT.TRIGGER_DUMP(7);
Query OK, 0 rows affected
Adjust the scheduled DUMP interval for the dictionary
CALL DBMS_DATA_DICT.MODIFY_DUMP_INTERVAL('FREQ=MINUTELY; INTERVAL=120');
Query OK, 0 rows affected
Adjust the retention interval for dictionary history records
CALL DBMS_DATA_DICT.MODIFY_DICT_ITEM_RETENTION(7);
Query OK, 0 rows affected