Get the App
SLTechnology News&Howtos  ›  Database  › 

AWR report generation-snapshot creation-modify-delete

Shulou Source: shulou.com Published: 2022-06-01 04:22:41 10月03日 Update

If necessary, DBA can manually create, delete, or modify snapshots through the DBMS_WORKLOAD_REPOSITORY process.

-- prompt that DBA permission is required to call the DBMS_WORKLOAD_REPOSITORY package.

-1. Manually create Snapshots manually create Snapshots through the DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT process

-- for example

Exec dbms_workload_repository.create_snapshot ()

-- you can then view the Snapshots information you just created through the DBA_HIST_SNAPSHOT view.

SELECT * FROM DBA_HIST_SNAPSHOT

-- 2 manually delete Snapshots

Deleting Snapshots is another procedure that uses the DBMS_WORKLOAD_REPOSITORY package DROP_SNAPSHOT_RANGE, which can be executed by specifying the scope of the snap_id to delete more than one Snapshot at a time

-- for example

Select count (0) from dba_hist_snapshot where snap_id between 6770 and 6774

Select max (snap_id) from dba_hist_snapshot

Select dbid from v$database

Exec dbms_workload_repository.drop_snapshot_range (low_snap_id = > 6770Gravity snapshots id = > 6774 Magi dbid = > 4059638244)

-- or

Begin

Dbms_workload_repository.drop_snapshot_range (

Low_snap_id = > 6770

High_snap_id = > 6774

Dbid = > 4059638244)

End

Select count (0) from dba_hist_snapshot where snap_id between 6770 and 6774

Tags: Manual process can be passed through information multiple methods permissions scope views prompts snapshots reports generation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Technology Shulou Tech Info Xiaomi Microsoft