Deleting old Trace files [message #396676] |
Tue, 07 April 2009 10:01 |
rsreddy28
Messages: 295 Registered: May 2007
|
Senior Member |
|
|
Hi all,
I'm trying to delete all the older trace files in my Oracle server . The script works fine if I specify the instance and location of trace files for that instance but I have multiple instances in my server and I'm not knowing how and where to modify the script to remove all the trace files for all the databases in that server.
ex:I have 3 databases in my server like
dba1
dba2
dba3
and the location of the trace files are
find /opt/oracle/product/10.2.0/admin/dba1(Database Name)/bdump
So i want the script to automatically take each database one by one and remove the files accordingly.
Can you help me on this please.
Regards,
Raj
-
Attachment: script.txt
(Size: 1.88KB, Downloaded 2623 times)
|
|
|
|
Re: Deleting old Trace files [message #396713 is a reply to message #396676] |
Tue, 07 April 2009 16:25 |
|
ebrian
Messages: 2794 Registered: April 2006
|
Senior Member |
|
|
Another option:
find /opt/oracle/product/10.2.0/admin/db[123]/bdump
Sorry, I just looked at your script you posted and your SID names may not lend themselves to using the method I provided above.
Are you stopping the listener prior to moving it's log file? If not, the listener would still have the old file handle open.
[Updated on: Tue, 07 April 2009 16:31] Report message to a moderator
|
|
|
|
|
Re: Deleting old Trace files [message #396750 is a reply to message #396748] |
Tue, 07 April 2009 23:42 |
rsreddy28
Messages: 295 Registered: May 2007
|
Senior Member |
|
|
we are trying to put in the crontab and would run for evvry 1 week. I think we can have a small if loop condition by passing each instance 1 variable . But I'm not knowing how to run the if loop.
Any take on this , please
|
|
|
|
Re: Deleting old Trace files [message #415106 is a reply to message #396676] |
Fri, 24 July 2009 17:08 |
olddba
Messages: 5 Registered: June 2009 Location: Longview, Wa
|
Junior Member |
|
|
try something like this for the trace files.
/usr/bin/find /opt/oracle/admin -name "*.trc" -mtime +7 -exec rm {} \;
I would check out logrotate for the listener log and alert logs.
|
|
|