The MODIFY_SNAPSHOT_SETTINGS procedure modifies the WORKLOAD_REPOSITORY settings.
Applicability
This system package is available only in the sys tenant.
Syntax
DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(
retention INT DEFAULT NULL,
interval INT DEFAULT NULL,
topnsql INT DEFAULT NULL,
sqlstat_interval INT DEFAULT NULL
);
Parameters
| Parameter | Description |
|---|---|
| retention | The retention period of snapshots, in minutes. Snapshots that exceed this period are automatically deleted. The value range is [1440 minutes (1 day), 52560000 minutes (100 years)].
|
| interval | The time interval between snapshots, in minutes. The value range is [10 minutes, 525600 minutes (1 year)].
|
| topnsql | The number of SQLSTAT records to be recorded when SQLSTAT snapshots are written to disk. |
| sqlstat_interval | The time interval between SQLSTAT snapshots, in minutes. |
Examples
Set the retention period of each snapshot to 2265 minutes (about 1 day and 12 hours), the time interval between snapshots to 16 minutes, the number of SQLSTAT records to be recorded to 30, and the time interval between SQLSTAT snapshots to 5 minutes.
obclient(root@sys)[(none)]> CALL DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS('2265','16', 30, 5);
References
For more information about snapshots in WR, see Set a snapshot strategy