ORACLE clean up SYSAUX table space

Found in the inspection database SYSAUX table space occupied is too large, SYSAUX is ORACLE10G started to provide functionality for database SYSTEM tablespace burdens.

To identify the corresponding table space values ​​with the following statement

select
a.tablespace_name,trunc(sum(a.bytes)/1024/1024/1024,2) total,
trunc(sum(a.bytes)/1024/1024/1024 - sum(b.bytes)/1024/1024/1024,2) used,
trunc(sum(b.bytes)/1024/1024/1024,2) free,
to_char(trunc((sum(a.bytes)/1024/1024/1024-sum(b.bytes)/1024/1024/1024)/(sum(a.bytes)/1024/1024/1024),4)*100)||'%' pused,
to_char(trunc((sum(b.bytes)/1024/1024/1024)/(sum(a.bytes)/1024/1024/1024),4)*100)||'%' pfree
from (select sum(bytes) bytes,tablespace_name from dba_data_files group by tablespace_name) a,(select sum(bytes) bytes,tablespace_name from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name(+)
group by a.tablespace_name;

Found SYSAUX table space occupancy rate is too high

 

 

SYSAUX utilization rate of 95% of its total 13.84G

What use so much space found by the following statement

SELECT occupant_name "Item",
space_usage_kbytes / 1048576 "Space Used (GB)",
schema_name "Schema",
move_procedure "Move Procedure"
FROM v$sysaux_occupants
ORDER BY 2 desc;

 

 

 Which can be seen from FIG. 11G space used AWR

Save a few days in view the AWR statistics

select dbms_stats.get_stats_history_retention from dual; 

 

 

 

 通过 select dbid, min(snap_id),max(snap_id) from dba_hist_snapshot group by dbid;

To identify the corresponding DBID and SNAP_ID,

  • Empty on a dbid in all snapshot

exec dbms_workload_repository.drop_snapshot_range(29737,29943,310691130);

Waiting too long '

In order to accelerate the removal rate of the following embodiments

Find those base tables occupied sysaux table space, sorted according to size

select * from (select segment_name,PARTITION_NAME,segment_type,bytes/1024/1024 from dba_segments where tablespace_name='SYSAUX' order by 4 desc) where rownum<=10;

Find out the following

 

Backup base table WRH $ ACTIVE_SESSION_HISTOR, WRH $ _SQLSTAS, WRH $ _EVENT_HISTOGRAM

create table WRH$_ACTIVE_SESSION_HISTORY0926 as select * from WRH$_ACTIVE_SESSION_HISTORY;
create table WRH$_SQLSTAT0926 as select * from WRH$_SQLSTAT;
create table WRH$_EVENT_HISTOGRAM0926 as select * from WRH$_EVENT_HISTOGRAM;
create table WRH$_LATCH0926 as select * from WRH$_LATCH;

Clears the corresponding data base tables

truncate  table  WRH$_ACTIVE_SESSION_HISTORY;
truncate  table  WRH$_EVENT_HISTOGRAM;
truncate  table  WRH$_SQLSTAT;
truncate  table  WRH$_LATCH_MISSES_SUMMARY;
truncate  table  WRH$_LATCH;
truncate  table  WRH$_SYSSTAT;
truncate  table  WRH$_SEG_STAT;
truncate  table  WRH$_PARAMETER;
truncate  table  WRH$_SYSTEM_EVENT;
truncate  table  WRH$_SQL_PLAN;
truncate  table  WRH$_DLM_MISC;
truncate  table  WRH$_SERVICE_STAT;
truncate  table  WRH$_TABLESPACE_STAT;
truncate  table  WRH$_ROWCACHE_SUMMARY;
truncate  table  WRH$_MVPARAMETER;

 

Guess you like

Origin www.cnblogs.com/flamechan1981/p/11593248.html