The system table space usage is 85%, and the aud$ table used to record audit records takes up a lot of space.
After the backup truncate off aud$, the problem is temporarily resolved. Remember oracle11.2 can move aud$ to normal table empty
Room So I tried it and it was OK.
1. Check system table space usage
- Sql*plus:release 11.2.0.3.0 Production on Mon Mar 11:21:18
- Copyright (c) 1982, Oracle. All rights reserved.
- Connected to :
- Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
- With the partitioning, Data Mining and Real application testing Options
- sql> Select
- 2 b.tablespace_name "table space",
- 3 b.bytes/1024/1024 "size M",
- 4 (b.bytes-sum (NVL (a.bytes,0)))/1024/1024 "used M",
- 5 substr ((b.bytes-sum (NVL (a.bytes,0))/(b.bytes) *100,1,5) "Utilization"
- 6 from dba_free_space a,dba_data_files b
- 7 where a.file_id=b.file_id
- 8 and b.tablespace_name=' SYSTEM '
- 9 GROUP by B.tablespace_name,b.file_name,b.bytes
- Ten order by B.tablespace_name;
- Table space size m using m utilization
- ------------------- ---------- ----------- ----------
- SYSTEM 4096 3485.9375 85.10
2. From Dba_segments, find the large object occupying the top 10 in the system table space.
[SQL]View Plaincopy
- Sql> Col segment_name for A15;
- Sql> SELECT *
- 2 from (SELECT segment_name, SUM (BYTES)/1024/1024 MB
- 3 from dba_segments
- 4 WHERE tablespace_name = ' SYSTEM '
- 5 GROUP by segment_name
- 6 ORDER by 2 DESC)
- 7 WHERE ROWNUM < 10;
- Find out the aud$ occupy a lot of space.
3. Prepare Truncate aud$ table
[SQL]View Plaincopy
- Sql> Show Parameter Audit_trail
- NAME TYPE VALUE
- --------------- ----------- ---------
- Audit_trail string DB
- <span style="Color:rgb (255, 0, 0); >--truncate aud$ table requires relevant permissions. </span>
- sql> truncate table aud$;
- Table truncated
4.truncate Check System tablespace usage and find usage reduced from 85% to 29.44%
[SQL]View Plaincopy
- sql> ANALYZE TABLE aud$ COMPUTE STATISTICS;
- Table analyzed.
- sql> Select
- 2 b.tablespace_name "table space",
- 3 b.bytes/1024/1024 "size M",
- 4 (b.bytes-sum (NVL (a.bytes,0)))/1024/1024 "used M",
- 5 substr ((b.bytes-sum (NVL (a.bytes,0))/(b.bytes) *100,1,5) "Utilization"
- 6 from dba_free_space a,dba_data_files b
- 7 where a.file_id=b.file_id
- 8 and b.tablespace_name=' SYSTEM '
- 9 GROUP by B.tablespace_name,b.file_name,b.bytes
- Ten order by B.tablespace_name;
- Table space size m using m utilization
- ---------------- ---------- ---------- ----------
- SYSTEM 4096 1206 29.44
5. To avoid the effect of full system table space on the data, migrate the aud$ from the system table space to the normal tablespace aud_file.
[SQL]View Plaincopy
- sql> BEGIN
- 2 dbms_audit_mgmt. Set_audit_trail_location (
- 3 Audit_trail_type = Dbms_audit_mgmt. AUDIT_TRAIL_AUD_STD,
- 4 Audit_trail_location_value = ' aud_file ');
- 5 END;
- 6/
- Sql> Col owner for A5;
- Sql> SELECT OWNER, table_name, Tablespace_name
- 2 from dba_tables
- 3 WHERE table_name = ' aud$ '
- 4 and OWNER = ' SYS ';
- OWNER table_name Tablespace_name
- ----- ------------------------------ ------------------------------
- SYS aud$ TD_FILB
oracle11g aud$ Maintenance