Re: cron job at linux to remove trace and audit files

From: Seth Miller <sethmiller.sm_at_gmail.com>
Date: Wed, 10 Jun 2015 13:24:02 -0500
Message-ID: <CAEueRAXVC3U2iQFKwNBKM0FV0fSaJaY5Yz0m4Kk+YQhM7nVxyQ_at_mail.gmail.com>



I find it interesting that with all of the responses you got, you implemented none of the recommendations.

On Wed, Jun 10, 2015 at 3:17 AM, Mostafa Eletriby < dmarc-noreply_at_freelists.org> wrote:

> Hello ,
> Thanks for all your support.
>
> I performed the required cron job using
> [root_at_Abohamad trace]# crontab -e
>
> [root_at_Abohamad trace]# crontab -l
> 30 16 * * * /opt/maintain-traces
> 00,05,10,15,20,25,30,35,40,45,50,55 * * * * /opt/maintain-traces-1
>
> I created two scripts with different schedules as shown below and it
> worked successfully.
>
> [root_at_Abohamad trace]# cat /opt/maintain-traces
> #!/usr/bin/ksh
> /bin/rm -rf /opt/oracle/base/diag/rdbms/cdsdb/cdsdb/trace/*.trc
> /bin/rm -rf /opt/oracle/base/diag/rdbms/cdsdb/cdsdb/trace/*.trm
> #/bin/rm -rf /opt/oracle/base/diag/rdbms/cdsdb/cdsdb/trace/cdmp*
> /bin/rm -rf /opt/oracle/base/admin/cdsdb/adump/*.aud
> [root_at_Abohamad trace]#
>
> [root_at_Abohamad trace]# cat /opt/maintain-traces-1
> #!/usr/bin/ksh
> /bin/rm -rf /opt/oracle/base/diag/rdbms/cdsdb/cdsdb/trace/cdmp*
> [root_at_Abohamad trace]#
> [root_at_Abohamad trace]#
>
> I think it will be better to use oracle user and good idea to remove
> traces larger than 10M,
> Currently I scheduled to remove traces for *.trc , *.trm , *.aud every day
> at 4;30 pm.
> All cron jobs will be a temporary solution until database upgrade will be
> performed to solve this bug.
>
> Thanks a lot for you all.
> Regards,
> Mostafa Eletriby
>
>
>
>
>
> On Tuesday, June 9, 2015 8:25 PM, Rich Jesse <
> rjoralist3_at_society.servebeer.com> wrote:
>
>
> > Something else that no-one has yet mentioned... I had an instinctive and
> > visceral knee jerk reaction when I saw 'rm -rf' running as root.
> > Is there any reason it has to run as root and not the database user?
>
>
> The paranoid in me was wondering of potential issues where trace files of
> active processes are wiped. Maybe something bad, maybe nothing, or maybe
> something in between like the file is inaccessible from the directory, but
> is still able to be written to by the Oracle process and therefore still
> taking up space.
>
> If it's large individual trace files, maybe a better approach is to use
> 'find':
>
> find $ADR_HOME/subdir/subdir -name "*.trc" -size +10M
>
> ...will only delete trace files larger than 10MB. Standard disclaimer
> applies.
>
> Just a thought...
>
> Rich
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 10 2015 - 20:24:02 CEST

Original text of this message