Link to home
Start Free TrialLog in
Avatar of hussainkhan22
hussainkhan22Flag for United States of America

asked on

purge audit files

hey how do we purge the older audit files and placed in crontab.
ASKER CERTIFIED SOLUTION
Avatar of MikeOM_DBA
MikeOM_DBA
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of johnsone
I would use the find command:

Man page for find

Look at the mtime and exec parameters.

You are going to want to hard code the directory to look at as your profile is not run as part of a cron job.

If you write a script and set up the environment in the script then use the find command, you can then schedule the job via cron.  This method allows you to do multiple cleanups with one cron job.
If your Oracle version is 11g, find+rm is useless because Oracle will re-create the trace files again if you remove them due to these files actually residing in the Automatic Diagnostic Repository .

You need to either: a) remove them with the 'adrci' utility or b) manually through EM or Grid Control.
The question is about audit files, not trace files.
Ooops, yes...

Audit files you need to manually remove as johnsone suggest.