#!/bin/ksh
############################################################################
# Script Name..: cleanup_audit_files.ksh
# Description..: Script to delete .aud and .xml logs older than 1 day.
# Author.......: 
# Date.........: 02/06/2014
# Version......:
# Modified By..:
# Date Modified:
# Comments.....:
# Schema owner.:
#    alter session set current
# Login User...:
# Run Order....:
# Dependent on.:
# Script type..:
#
############################################################################

date
# Whatever the CRS directory is
find /oracle_crs/product/11.2.0/crs_2/rdbms/audit/ -name "*.aud" -mtime +1 -type f -print -delete

find /oracle/admin/*/adump/ -name "*.aud" -mtime +1 -type f -print -delete
find /oracle/admin/*/adump/ -name "*.xml" -mtime +1 -type f -print -delete

find /ora01/adump/ -name "*.aud" -mtime +1 -type f -print -delete
find /ora01/adump/ -name "*.xml" -mtime +1 -type f -print -delete

find /ora01/audit/ -name "*.aud" -mtime +1 -type f -print -delete
find /ora01/audit/ -name "*.xml" -mtime +1 -type f -print -delete
find /ora01/audit_maint/ -name "*.aud" -mtime +1 -type f -print -delete
find /ora01/audit_maint/ -name "*.xml" -mtime +1 -type f -print -delete
find /ora01/audit_test/ -name "*.aud" -mtime +1 -type f -print -delete
find /ora01/audit_test/ -name "*.xml" -mtime +1 -type f -print -delete
find /oracle_crs/product/11.2.0/crs_2/rdbms/audit/ -name "*.aud.tar.gz" -mtime +1 -type f -print -delete
find /oracle/admin/*/adump/ -name "*.aud.tar.gz" -mtime +1 -type f -print -delete
find /ora01/adump/ -name "*.aud.tar.gz" -mtime +1 -type f -print -delete
find /ora01/audit/ -name "*.aud.tar.gz" -mtime +1 -type f -print -delete
find /ora01/audit_maint/ -name "*.aud.tar.gz" -mtime +1 -type f -print -delete
find /ora01/audit_test/ -name "*.aud.tar.gz" -mtime +1 -type f -print -delete

date

Ready for Action?

LET'S GO!
Copyright 2024 IT Remote dot com
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram