The RECYCLE_SCHEMA_HISTORY procedure manually triggers a round of Schema multi-version history data recycling for the current tenant, clearing expired records. The expiration time for Schema multi-version history data is controlled by the tenant-level parameter schema_history_expire_time.
Limitations and considerations
Only user tenants support manual execution of Schema multi-version history data recycling; system tenants do not support this feature.
Syntax
DBMS_SCHEMA.RECYCLE_SCHEMA_HISTORY();
Considerations
A built-in scheduled task named SCHEDULED_RECYCLE_SCHEMA_HISTORY is used to periodically recycle expired Schema multi-version history data, with a default interval of 10 minutes. The execution interval of this scheduled task can be adjusted using the repeat_interval attribute of the DBMS_SCHEDULER.SET_ATTRIBUTE subprogram. For example, to change the interval to 60 minutes:
obclient(root@mysql001)[(none)]> CALL DBMS_SCHEDULER.SET_ATTRIBUTE('SCHEDULED_RECYCLE_SCHEMA_HISTORY', 'repeat_interval', 'FREQ=MINUTELY; INTERVAL=60');
Before the scheduled task's execution time, users can manually call the DBMS_SCHEMA.RECYCLE_SCHEMA_HISTORY() subprogram to quickly trigger a round of Schema multi-version history data recycling.
Examples
A user tenant performs a round of Schema multi-version history data recycling for itself.
obclient(root@mysql001)[(none)]> CALL DBMS_SCHEMA.RECYCLE_SCHEMA_HISTORY();
