How to Move Audit Trail tables to New Tablespaces in Oracle

Hi,

I will explain how to move audit tables ( SYS.aud$ and SYS.fga_log$ ) to new tablespaces in Oracle

 

audit

 

Audit trail tables called SYS.aud$ and SYS.fga_log$ keeps all Audit records in the Oracle database and these tables are owned by SYS and system tablespace is default tablespace for them. System tablespace grows day by day because of these Audit trail records.

To solve this problem, you need to change default tablespace of these tables.

 

You can check these tables and their tablespaces like following.

SQL> Select table_name, tablespace_name from dba_tables where table_name in ('AUD$', 'FGA_LOG$');

TABLE_NAME                            TABLESPACE_NAME
------------------------------------------------------------------------

AUD$                                            SYSTEM
FGA_LOG$                                   SYSTEM

 

You can change default tablespace of Audit trail tables bu using DBMS_AUDIT_MGMT package like following.

 

 SQL> BEGIN
 DBMS_AUDIT_MGMT.set_audit_trail_location(
 audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,
 audit_trail_location_value => 'NEW_TABLESPACE_NAME');
END;
/
SQL> BEGIN
 DBMS_AUDIT_MGMT.set_audit_trail_location(
 audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD,
 audit_trail_location_value => 'NEW_TABLESPACE_NAME');
END;
/
After execute above commands, you can check these tables and their tablespaces like following.
SQL> Select table_name, tablespace_name from dba_tables where table_name in ('AUD$', 'FGA_LOG$');

TABLE_NAME                            TABLESPACE_NAME
------------------------------------------------------------------------

AUD$                                           NEW_TABLESPACE_NAME
FGA_LOG$                                 NEW_TABLESPACE_NAME

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

https://ittutorial.org/oracle-database-19c-tutorials-for-beginners/

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *