The DROP_SNAPSHOT_RANGE procedure deletes snapshots within the specified range.
Applicability
This system package is available only in the sys tenant.
Syntax
DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE(
low_snap_id INT,
high_snap_id INT
);
Parameters
| Parameter | Description |
|---|---|
| low_snap_id | The minimum ID of snapshots to be dropped. |
| high_snap_id | The maximum ID of snapshots to be dropped. |
Examples
Delete snapshots with IDs in the range '123' to '456'.
obclient(root@sys)[(none)]> CALL DBMS_WORKLOAD_REPOSITORY.DROP_SNAPSHOT_RANGE('123','456');Check if the snapshots with the specified SNAP_ID were deleted.
obclient(root@sys)[(none)]> select count(1),min(snap_id), max(snap_id) from oceanbase.DBA_WR_SNAPSHOT;The returned result is:
+----------+--------------+--------------+ | count(1) | min(snap_id) | max(snap_id) | +----------+--------------+--------------+ | 1 | -1 | -1 | +----------+--------------+--------------+The result indicates that the snapshots with IDs in the specified range have been deleted.
References
For more information about snapshots in WR, see Configure a snapshot policy