The CREATE_SNAPSHOT procedure triggers the generation of a snapshot for a cluster and is available only in the sys tenant.
Syntax
DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT(
flush_level VARCHAR(64) DEFAULT 'TYPICAL'
);
Parameters
| Parameter | Description |
|---|---|
| flush_level | The type of the snapshot. Currently, only the TYPICAL type is supported, which specifies to periodically generate snapshots to collect most statistics. |
Considerations
Each time after you manually create a snapshot, the timer restarts. For example, assume that snapshots are created at the default interval of 1 hour:
At 12:21, the timer triggers the creation of a snapshot.
At 13:21, the timer triggers the creation of the next snapshot.
At 13:45, the user manually creates a snapshot.
At 14:45, the timer triggers the creation of the next snapshot.
Examples
obclient [SYS]> CALL DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT(flush_level => 'TYPICAL');
Query OK, 0 rows affected