Purge AWR Snapshots Manually from Oracle Database

advertisements

_____________________________________________________________________________________________________________________

The Eucharistic Miracles of the World
Query to find AWR snapshot retention period using below query.

SQL> select dbms_stats.get_stats_history_retention from dual;

GET_STATS_HISTORY_RETENTION
---------------------------
			 31

Query to check the snapshot interval.

SQL> SELECT SNAP_INTERVAL, RETENTION FROM DBA_HIST_WR_CONTROL;

SNAP_INTERVAL								    RETENTION
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
+00000 01:00:00.0							    +00008 00:00:00.0
advertisements
 
SQL to purge AWR snapshots which are older than x days. In below example 30 days. This will purge the snapshots which are older than 30 days.

SQL> exec dbms_stats.purge_stats(SYSDATE-30);

PL/SQL procedure successfully completed.

SQL to purge awr snapshots with snap id range.

SQL> EXECUTE dbms_workload_repository.drop_snapshot_range(low_snap_id =>27 , high_snap_id =>30);

PL/SQL procedure successfully completed.

_____________________________________________________________________________________________________________________

Website Stats

0 comments:

Post a Comment

Labels

Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2)
 

acehints.com Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer