The RECYCLE_SCHEMA_HISTORY procedure is used to manually recycle the history data of schema versions for the current tenant, clearing out expired records. The expiration time for schema version history data is controlled by the tenant-level parameter schema_history_expire_time.
Limitations and considerations
Only user tenants support manual recycling of schema version history data. 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 version history data, with a default interval of 10 minutes. The execution interval of this scheduled task can be set using the repeat_interval attribute of the DBMS_SCHEDULER.SET_ATTRIBUTE procedure. For example, to change the execution interval of the SCHEDULED_RECYCLE_SCHEMA_HISTORY task to 60 minutes:
obclient(sys@oracle001)[SYS]> 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() procedure to quickly recycle schema version history data.
Examples
A user tenant recycles schema version history data for its own tenant.
obclient(sys@oracle001)[SYS]> CALL DBMS_SCHEMA.RECYCLE_SCHEMA_HISTORY();
