Database Administration (MOSC)

MOSC Banner

purging from the SYS.AUD$ table

edited Aug 14, 2011 6:58AM in Database Administration (MOSC) 2 commentsAnswered
Hi,

   We are planning to purging from the SYS.AUD$ table on a daily basis using the following script. Any recommendations will be highly appreciated.

------
-PROD-
------

CONNECT SYS

ALTER SESSION SET NLS_LANGUAGE = 'AMERICAN';

DECLARE
  X NUMBER;
  
BEGIN
 
  SYS.DBMS_JOB.ISUBMIT
  (
    job       => 777
   ,what      => 'BEGIN DELETE FROM SYS.AUD$ WHERE NTIMESTAMP# < add_months(SYSDATE, -13); COMMIT; END;'
   ,next_date => TO_DATE(SYSDATE + 20/24,'YYYY/MM/DD')
   ,interval  => 'TO_DATE(TO_CHAR(SYSDATE + 1,''YYYY/MM/DD'') || ''20:00'',''YYYY/MM/DD:HH24:MI'')'
  );
COMMIT;
END;
/

COMMIT;

-----EPURATION INITIAL
delete SYS.AUD$
WHERE NTIMESTAMP# < TO_DATE('01-01-2011','DD-MM-YYYY');

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center