The RECYCLE_SCHEMA_HISTORY statement is used to manually perform a round of recycling for the current tenant's multi-version schema history data, clearing expired records. The expiration time for multi-version schema history data is controlled by the tenant-level parameter schema_history_expire_time.
Limitations and considerations
Only user tenants support manual reclamation of multi-version historical data for schemas. The system tenant does not support manual reclamation.
Syntax
DBMS_SCHEMA.RECYCLE_SCHEMA_HISTORY();
Usage instructions
The system provides a scheduled task named SCHEDULED_RECYCLE_SCHEMA_HISTORY to periodically recycle expired multi-version historical data of schemas. By default, it is triggered every 10 minutes. You can set the trigger interval using the repeat_interval attribute of the DBMS_SCHEDULER.SET_ATTRIBUTE subprogram. For example, to change the trigger interval of the SCHEDULED_RECYCLE_SCHEMA_HISTORY task to 60 minutes:
obclient(root@mysql001)[(none)]> CALL DBMS_SCHEDULER.SET_ATTRIBUTE('SCHEDULED_RECYCLE_SCHEMA_HISTORY', 'repeat_interval', 'FREQ=MINUTELY; INTERVAL=60');
If the scheduled execution time for a task has not yet arrived, you can manually call the DBMS_SCHEMA.RECYCLE_SCHEMA_HISTORY() subprogram to quickly execute a round of multi-version history data for schemas.
Examples
The user tenant performs a round of schema multi-version historical data reclamation for itself.
obclient(root@mysql001)[(none)]> CALL DBMS_SCHEMA.RECYCLE_SCHEMA_HISTORY();
