Dump below is of a session clearing the sysaux tablespace. It turned out that something went wrong with the automatic AWR gathering/purging and the sysaux tablespace became very large.
Thanks to this blog I found script below wich displays the various sysaux components and their sizes.
Next thing I retrieve the oldest and latest AWR snapshot, turns out to be 2007…
SQL> SELECT
2 snap_id, begin_interval_time, end_interval_time
3 FROM
4 SYS.WRM$_SNAPSHOT
5 WHERE
6 snap_id = ( SELECT MIN (snap_id) FROM SYS.WRM$_SNAPSHOT)
7 UNION
8 SELECT
9 snap_id, begin_interval_time, end_interval_time
10 FROM
11 SYS.WRM$_SNAPSHOT
12 WHERE
13 snap_id = ( SELECT MAX (snap_id) FROM SYS.WRM$_SNAPSHOT)
14 /
SNAP_ID BEGIN_INTERVAL_TIME END_INTERVAL_TIME
---------- --------------------- ---------------------
7556 15-09-07 08:44:42,810 15-09-07 11:01:11,950
23698 18-08-09 11:00:41,612 18-08-09 12:00:53,074
I prefer SYS.WRM$_SNAPSHOT instead of DBA_HIST_SNAPSHOT because I saw strange results in (Release 10.1.0.5).
Now use the dbms_workload_repository package to remove the AWR snapshots.
BEGIN
dbms_workload_repository.drop_snapshot_range(low_snap_id => 7556, high_snap_id=>15000);
END;
/
Speed up ‘removal’ of old AWR reports
@#$%^&*()_ removing the entries takes ages and fails on undo errors … Metalink note Doc ID: 852028.1 states that I can safely remove the AWR metadata tables and recreate them.
If none of the above suits as everything is set proper then consider clean up and rebuild AWR repository to clear all the space.
SQL> connect / as sysdba
SQL> @?/rdbms/admin/catnoawr.sql
SQL> @?/rdbms/admin/catawrtb.sql
3 Responses to “Purging SYSAUX tablespace (Purging AWR reports)”
Thanks for this info. It has saved me time.
This is awesome. Thank you!
ming
Thank you a lot for this interesting tips, it worked fine for me and save me time.