关闭12CR1用户审计策略,释放sysaux表空间
关闭12CR1用户审计策略,释放sysaux表空间
云中月- 2020-07-14 11:37:41 24 收藏
分类专栏: Oracle
版权
1.查询sysaux表空间使用量:
set line 140
col tablespace_name for a30
select T.tablespace_name,T.TOTAL_SPACE_MB,(T.TOTAL_SPACE_MB-F.FREE_SPACE_MB) "USED_SPACE_MB",F.FREE_SPACE_MB,
(100-ROUND((T.TOTAL_SPACE_MB-F.FREE_SPACE_MB)/T.TOTAL_SPACE_MB*100,2)) "FREE_RATE %",
ROUND((T.TOTAL_SPACE_MB-F.FREE_SPACE_MB)/T.TOTAL_SPACE_MB*100,2) "USED_RATE %"
FROM
(SELECT TABLESPACE_NAME,SUM(BYTES/1024/1024) "TOTAL_SPACE_MB" FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) T,
(SELECT TABLESPACE_NAME,ROUND(SUM(BYTES/1024/1024),2) "FREE_SPACE_MB" FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) F
WHERE T.TABLESPACE_NAME = F.TABLESPACE_NAME ORDER BY 6;
也可以使用Oracle脚本工具评估表空间大小情况:
sqlplus / as sysdba
@?/rdbms/admin/awrinfo.sql
@?/rdbms/admin/utlsyxsz.sql
2.确认表空间大小原因:
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
/
3.查询审计策略:
select USER_NAME,POLICY_NAME,ENABLED_OPT,SUCCESS,FAILURE from AUDIT_UNIFIED_ENABLED_POLICIES;
4.关闭用户审计策略:
noaudit policy ALL_ACTIONS_POL by username;
https://docs.oracle.com/database/121/DBSEG/audit_config.htm#DBSEG697
5.手动清理
begin
dbms_audit_mgmt.clean_audit_trail(
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,
use_last_arch_timestamp => FALSE);
end;
/
6.再检查表空间使用量,已经全部释放
7.关于审计相关部分见:
https://docs.oracle.com/database/121/DBSEG/audit_config.htm#GUID-3553BD14-1077-40A7-9A8A-4519AE2F3B1C
————————————————
版权声明:本文为CSDN博主「云中月-」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wulinpingailxr/java/article/details/107332455