Oracle 12.2处理sysaux空间占满问题
作者:徐sir(徐慧阳)
今天处理别的问题查看告警日志偶然发现大量的报错,无法扩展SYSAUX表空间,于是登录系统,查看系统表空间使用情况,发现SYSAUX表空间用满了,所以本文给大家介绍了Oracle 12.2处理sysaux空间占满问题,需要的朋友可以参考下
基本环境
数据库:oracle 12.2 RAC
操作系统:unix&solaris 11.3
报错现像
今天处理别的问题查看告警日志偶然发现大量的报错,无法扩展SYSAUX表空间
于是登录系统,查看系统表空间使用情况,发现SYSAUX表空间用满了
查看SYSAUX表空间情况
使用SQL检查一下占用,
SELECT occupant_name"Item",round(space_usage_kbytes/1024/1024,3)"Space Used (GB)",schema_name "Schema",move_procedure "MoveProcedure" FROM v$sysaux_occupants ORDER BY 2 Desc;
返回如下:
再检查segment_names查看
select * from ( select segment_name,sum(bytes)/1024/1024 total_mb,tablespace_name from dba_segments where tablespace_name in ('SYSTEM','SYSAUX') group by segment_name,tablespace_name order by 2 desc) where rownum <=20;
返回如下:
释放表空间AUD$UNIFIED
需要用到Dbms包来处理
BEGIN DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL( audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED, container => DBMS_AUDIT_MGMT.CONTAINER_CURRENT, use_last_arch_timestamp => FALSE); END; /
use_last_arch_timestamp这个地方有两个选项:
USE_LAST_ARCH_TIMESTAMP
: Enter either of the following settings:TRUE
: Deletes audit records created before the last archive timestamp. To set the archive timestamp, see Step 3: Optionally, Set an Archive Timestamp for Audit Records. The default (and recommended) value is . Oracle recommends that you set to .TRUE
USE_LAST_ARCH_TIMESTAMP
TRUE
FALSE
: Deletes all audit records without considering last archive timestamp. Be careful about using this setting, in case you inadvertently delete audit records that should not have been deleted.
处理完再次查看
清理之后会留下清理记录,可通过SQL查看
select * from UNIFIED_AUDIT_TRAIL where OBJECT_NAME='DBMS_AUDIT_MGMT' and OBJECT_SCHEMA='SYS' AND SQL_TEXT LIKE '%DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL%';
到此这篇关于Oracle 12.2处理sysaux空间占满问题的文章就介绍到这了,更多相关Oracle sysaux空间占满内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!