Wednesday, 19 June 2019

How to Manage Default Parameter Audit_sys_operations=True and Manage Audit log Size

This article is depending on database parameter audit_sys_operations. This parameter by default is true in 12cR1 to onward in this article we are managing the log file size and we can see that how can we change the value of this parameter.

[furqandb@ebstest ~]$ sqlplus sys as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue May 28 10:05:23 2019

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>
SQL> show parameter audit

NAME                                 TYPE        VALUE
------------------------------------ ----------- ----------------------------------------
audit_file_dest                          string          /u01/test/db/tech_st/12.1.0/rdbms/audit
audit_sys_operations                boolean       TRUE
audit_syslog_level                    string
audit_trail                                 string            NONE
unified_audit_sga_queue_size integer         1048576

SQL>  alter system set audit_sys_operations=false scope=spfile;

System altered.

SQL> shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup;
ORACLE instance started.
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
Total System Global Area 3221225472 bytes
Fixed Size                   2929552 bytes
Variable Size               905972848 bytes
Database Buffers         2298478592 bytes
Redo Buffers               13844480 bytes
Database mounted.
Database opened.
SQL>
SQL> show parameter audit

NAME                                      TYPE      VALUE
------------------------------------ ----------- ---------------------------------------
audit_file_dest                          string       /u01/test/db/tech_st/12.1.0/rdbms/audit
audit_sys_operations                 boolean   FALSE
audit_syslog_level                     string
audit_trail                                   string      NONE
unified_audit_sga_queue_size   integer    1048576
SQL>

Five Days
==========
[furqandb@ebstest audit]$ find /u01/test/db/tech_st/12.1.0/rdbms/audit/ -type f -name '*.aud' -mtime +5 -exec rm {} \;

Three Days
==========
[furqandb@ebstest audit]$ find /u01/test/db/tech_st/12.1.0/rdbms/audit/ -type f -name '*.aud' -mtime +3 -exec rm {} \;

Source: Internal R&D

No comments:

Post a Comment