You are on page 1of 3

10:26, 04/11/2022 Document 1328239.

Last Login: October 26, 2022 2:05 PM ICT Switch to Cloud Support
PowerV Duc (Available) (0) Contact Us Help

Dashboard Knowledge Service Requests Patches & Updates Community

Give Feedback...
Copyright (c) 2022, Oracle. All rights reserved. Oracle Confidential.

How To Move The DB Audit Trails To A New Tablespace Using DBMS_AUDIT_MGMT? (Doc ID 1328239.1) To Bottom

In this Document Was this document helpful?

Goal Yes
No
Solution
References
Document Details

Type:
HOWTO
Status:
APPLIES TO: Last Major
PUBLISHED
Update: Jan 21, 2019
Jan 30, 2022
Oracle Database - Enterprise Edition - Version 11.2.0.2 and later Last
Oracle Database Cloud Schema Service - Version N/A and later Update: English
Language:
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Related Products
Information in this document applies to any platform.
Oracle Database - Enterprise
Edition
GOAL Oracle Database Cloud
Schema Service
Gen 1 Exadata Cloud at
How to move the database audit trail tables( SYS.AUD$ & SYS.FGA_LOG$) to another tablespace using DBMS_AUDIT_MGMT? Customer (Oracle Exadata
Database Cloud Machine)
Oracle Cloud Infrastructure -
SOLUTION Database Service
Oracle Database Exadata
1) Check the current tablespace of the audit trail tables: Express Cloud Service
Show More

Information Centers
CONN / AS SYSDBA Information Center:
Transportable Tablespaces
SQL> SELECT table_name, tablespace_name FROM dba_tables (TTS) for Oracle Database
WHERE table_name IN ('AUD$', 'FGA_LOG$') ORDER BY table_name; 2 [1461278.2]

TABLE_NAME TABLESPACE_NAME 19c Database Upgrade - Self


------------------------------ ------------------------------ Guided Assistance with Best
Practices [1919.2]
AUD$ SYSAUX
FGA_LOG$ SYSAUX Index of Oracle Database
Information Centers
[1568043.2]

2) Check the current size of two tables: インフォメーション・センタ


ー: データベースおよび
Enterprise Manager 日本語ド
キュメント [1946305.2]
select segment_name,bytes/1024/1024 size_in_megabytes from dba_segments where segment_name in
('AUD$','FGA_LOG$'); Information Center: Data
Warehousing [1487754.2]
SEGMENT_NAME SIZE_IN_MEGABYTES
Show More
------------------- -----------------------------
AUD$ 12
FGA_LOG$ .0625 Document References
Primary Note For Oracle
Database Auditing
[1299033.1]

New Feature
DBMS_AUDIT_MGMT To
3) Create a new tablespace and make sure that it's size is large enough for the tables that will be moved: Manage And Purge Audit
Information [731908.1]

Known Issues When Using:


DBMS_AUDIT_MGMT
SQL>create tablespace audit_tbs datafile '/u01/app/oracle/oradata/d1v11202/audit_tbs1.dbf' size 100M [804624.1]
autoextend on;

Tablespace created. Recently Viewed

How to restore and recover


a database from an RMAN
backup. [881395.1]
How to Find CPU Processor

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=425497181845308&parent=EXTERNAL_SEARCH&sourceId=HOWTO&id=1328… 1/3
10:26, 04/11/2022 Document 1328239.1
4) Move the audit trail tables using procedure DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION. Information in Solaris
[1444358.1]
EM 13c, EM 12c: How To
Manually Add Database
Targets in EM Cloud Control
and Known Issues
SQL> BEGIN [1371846.1]
DBMS_AUDIT_MGMT.set_audit_trail_location( OLR Integrity Check Failed
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,--this moves table AUD$ During 11gR2 Database
audit_trail_location_value => 'AUDIT_TBS'); Software installation in
END; Oracle Restart [1487970.1]
/ PRVG-2032 : Group of file
PL/SQL procedure successfully completed. "/etc/oracle/olr.loc" did not
match the expected value on
Node "server". [Expected =
SQL> BEGIN "dba" ; Found = "oinstall"]
DBMS_AUDIT_MGMT.set_audit_trail_location( [2191489.1]
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD,--this moves table FGA_LOG$ Show More
audit_trail_location_value => 'AUDIT_TBS');
END;
/
PL/SQL procedure successfully completed.

4) Check whether the tables were moved successfully:

SQL> SELECT table_name, tablespace_name FROM dba_tables


WHERE table_name IN ('AUD$', 'FGA_LOG$') ORDER BY table_name;

TABLE_NAME TABLESPACE_NAME
----------------------- ------------------------------
AUD$ AUDIT_TBS
FGA_LOG$ AUDIT_TBS

NOTE :
=======
The requirement for the introduction of this package came from Audit Vault. Currently it is not supported to use the
DBMS_AUDIT_MGMT package on a pre 11gR2(11.2.0.1) instance which is not an Audit Vault source database. Its features
include the purge of audit records and can be used to move the audit tables AUD$ and FGA_LOG$ to another tablespace.

Audit Trails with dbms_audit_mgmt, which has been officially introduced/supported in Oracle 11g R2.

If you have huge aud$ table of size tens of GB then below procedure can be followed to move aud$ to new tablespace by
taking backup.

It is advised to do this procedure during off peak hours.

i) CREATE TABLE backup_aud$ AS SELECT * from sys.aud$;

ii) truncate table aud$;

iii) export table backup_aud$:

[oracle@seclin4 ~]$ exp file=aud_backup.dmp tables=backup_aud$

iv) Move aud$ to another tablespace using Doc ID 73408.1

v) Copy data back to aud$ table

SQL>insert into aud$ select * from backup_aud$;


SQL>commit;

vi) drop table backup_aud$

After you complete the above activity the new audit data should be moving to the new tablespace which you have created
for aud$ table.

REFERENCES

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=425497181845308&parent=EXTERNAL_SEARCH&sourceId=HOWTO&id=1328… 2/3
10:26, 04/11/2022 Document 1328239.1
NOTE:1299033.1 - Primary Note For Oracle Database Auditing
NOTE:731908.1 - New Feature DBMS_AUDIT_MGMT To Manage And Purge Audit Information
NOTE:804624.1 - Known Issues When Using: DBMS_AUDIT_MGMT
Didn't find what you are looking for? Ask in Community...

Related
Products

Oracle Database Products > Oracle Database Suite > Oracle Database > Oracle Database - Enterprise Edition > RDBMS
Oracle Cloud > Oracle Platform Cloud > Oracle Database Cloud Service > Oracle Database Cloud Schema Service
Oracle Cloud > Oracle Infrastructure Cloud > Oracle Cloud at Customer > Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine)
Oracle Cloud > Oracle Platform Cloud > Oracle Cloud Infrastructure - Database Service > Oracle Cloud Infrastructure - Database Service
Oracle Cloud > Oracle Platform Cloud > Oracle Database Cloud Service > Oracle Database Exadata Express Cloud Service
Oracle Cloud > Oracle Platform Cloud > Oracle Database Backup Service > Oracle Database Backup Service
Oracle Cloud > Oracle Platform Cloud > Oracle Database Cloud Exadata Service > Oracle Database Cloud Exadata Service
Oracle Cloud > Oracle Platform Cloud > Oracle Database Cloud Service > Oracle Database Cloud Service

Keywords
AUDIT; AUDIT TRAIL; TABLESPACE
Translations

English Source Japanese 日本語

Back to Top
Copyright (c) 2022, Oracle. All rights reserved. Legal Notices and Terms of Use Privacy Statement

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=425497181845308&parent=EXTERNAL_SEARCH&sourceId=HOWTO&id=1328… 3/3

You might also like