Re: Audit Purge Script

From: kathryn axelrod <kat.axe_at_gmail.com>
Date: Thu, 29 Mar 2012 15:09:03 -0700
Message-ID: <CAEbHM44HXzkYOY2mVje7sTSGTJVc6V84eOBc1LnZa9WY+4RpRA_at_mail.gmail.com>



But at this creation point, what is 90 or 91 to this package? It's meaningless.

First you have to create the package saying in essence, when running this package, there will be an incoming (number) value. Then, when you actually run the package is when you can give it that value.

So, create the package (using the syntax below *exactly* as is):

create or replace procedure purge_audit_trail (days in number) as   purge_date date;
begin
  purge_date := trunc(sysdate-days);
  dbms_system.ksdwrt(2,'AUDIT: Purging Audit Trail until ' ||

                        purge_date || ' started');
  delete from aud$ where ntimestamp# < purge_date;   commit;
  dbms_system.ksdwrt(2,'AUDIT: Purging Audit Trail until ' ||
                        purge_date || ' has completed');
end;
/

And then run it:

exec purge_audit_trail(90);

On Thu, Mar 29, 2012 at 3:02 PM, Nagaraj S <nagaraj.chk_at_gmail.com> wrote:
> yeah your right. i using the script from
> http://www.pythian.com/news/1106/oracle-11g-audit-enabled-by-default-but-what-about-purging/ .
> However when i gave 90 it gave me error
>
>> SQL> create or replace procedure purge_audit_trail ('90') as
..

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Mar 29 2012 - 17:09:03 CDT

Original text of this message