Note : These steps have been tested on DB that is older to 10G
To move the AUD$ table one can use the DBMS_AUDIT_MGMT package, as documented in:
Note 731908.1- "New Feature DBMS_AUDIT_MGMT To Manage And Purge Audit Information"
We need to move the AUD$ table to a locally managed tablespace.
To move the table to a locally managed tablespace with ASSM and then shrink it do the following:
1)
conn / as sysdba
BEGIN
DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_DB_STD,
audit_trail_location_value => 'USERS');
END;
/
BEGIN
DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_DB_STD,
audit_trail_location_value => 'USERS');
END;
/
This is manual process of doing it (for pre 11g DB)
2)
alter table sys.aud$ enable row movement;
alter table sys.aud$ shrink space cascade;
alter table sys.aud$ shrink space cascade;
Comment: if Oracle Label Security (OLS) option is installed and enabled the AUD$ table resides in the SYSTEM schema.
3) If needed the table can be moved back to the SYSTEM tablespace:
BEGIN
DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_DB_STD,
audit_trail_location_value => 'SYSTEM');
END;
/
DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_DB_STD,
audit_trail_location_value => 'SYSTEM');
END;
/
Audit Trail Management and Cleanup (including DBMS_AUDIT_MGMT package) is a supported feature for all RDBMS from 11.2. (Standard Edition and Enterprise Edition)
No comments:
Post a Comment