Oracle audit table AUD $ Handling Method

Source: Internet
Author: User

Oracle audit table AUD $ processing method Oracle version: 11.2.0, other versions should test whether DBMS_AUDIT_MGMT is successful 1. query the table, and then truncate

     select count(*) from aud$;     truncate table aud$;     select count(*) from aud$;

 

2. Create a tablespace
create tablespace adttbs        datafile '/oracle/OMT/admin/oradata/aud01.dbf'  size 2G autoextend on;SELECT table_name, tablespace_name FROM dba_tables WHERE table_name IN ('AUD$', 'FGA_LOG$') ORDER BY table_name;

 

3. aud $ move table to new tablespace
BEGINDBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_DB_STD,audit_trail_location_value => 'ADTTBS');END;/

 

4. sys user procedure:
Create or replace procedure sp_trunc_audit_log isbegin execute immediate 'truncate table aud $ '; end; authorization: grant execute on sp_trunc_audit_log to system;

 

5. system user procedure:
create or replace procedure sp_job_trunc_audit_log isbegin    sys.sp_trunc_audit_log;end;

 

6. Automatic job Scheduling
BEGIN  DBMS_SCHEDULER.CREATE_JOB   (    job_name   => 'day_trunc_audit_log',    job_type   => 'STORED_PROCEDURE',    job_action => 'SP_JOB_TRUNC_AUDIT_LOG',    start_date => sysdate,    repeat_interval => 'FREQ=DAILY; BYHOUR=04; BYMINUTE=05;INTERVAL=1',    enabled         => true,    comments        => 'every day truncate table audit log'  );END;

 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.