Home » RDBMS Server » Server Administration » How to prune Alert Log file & Background Trace Files? (UNIX system)
How to prune Alert Log file & Background Trace Files? (UNIX system) [message #60235] Mon, 26 January 2004 22:47 Go to next message
Patrick Tahiri
Messages: 119
Registered: January 2004
Senior Member
Hi,

I have a large Alert Log file and I would like to know what are the UNIX commands to delete/prune a part of this Log file? I want to "erase"/prune of course the oldest part and hold the most recent written part of this log file!

I could use vi, and then select an area and delete it, but the file is so large, it will take too much time!

Thank you very much in advance!

Regards,

Patrick Tahiri.

 
Re: How to prune Alert Log file & Background Trace Files? (UNIX system) [message #60239 is a reply to message #60235] Tue, 27 January 2004 02:23 Go to previous messageGo to next message
jack
Messages: 123
Registered: September 2000
Senior Member
rm -rf *

;)
Re: How to prune Alert Log file & Background Trace Files? (UNIX system) [message #60245 is a reply to message #60239] Tue, 27 January 2004 05:13 Go to previous messageGo to next message
Sanjay
Messages: 236
Registered: July 2000
Senior Member
Wow ... easy on that command...

Here is what I do. Periodically, I rename the log files (with an easy date stamp) and keep for about a month. Also delete really old trace files...

1. cd $ORACLE_HOME/rdbms/log
2. mv alert_SID.log alert_SID_20040127.log
3. touch alert_SID.log

I do this as needed, or you can do it evey Monday or something... In this manner, the file size also stays small.

As for UDUMP dest files, delete the old ones as needed. (more than 90 days ?)

NOTE: you can do the same with the listener.log file.

Cheers.
Re: How to prune Alert Log file & Background Trace Files? (UNIX system) [message #60252 is a reply to message #60235] Tue, 27 January 2004 08:43 Go to previous messageGo to next message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
Patrick,
if you want to retain the last say 1000 lines, you could tail it ..

mv alert[[SID]].log alert[[SID]]_[[DATE]].log
tail -1000 alert[[SID]]_[[DATE]].log > alert[[SID]].log

Now you are left with a backup alert.log file that you can move to tapes and an active alert.log file that has the latest 1000 lines.. there are other ways too(like limiting to a certain size or the last 1 month and so on)..
Re: How to prune Alert Log file & Background Trace Files? (UNIX system) [message #60258 is a reply to message #60245] Tue, 27 January 2004 20:36 Go to previous messageGo to next message
etryblr
Messages: 28
Registered: December 2003
Junior Member
$ >&#124alert.log
will clear the contents of the file
If u want, u can take the bckup and try this.

regards
Prashanth
Re: How to prune Alert Log file & Background Trace Files? (UNIX system) [message #60259 is a reply to message #60252] Tue, 27 January 2004 21:51 Go to previous message
Patrick Tahiri
Messages: 119
Registered: January 2004
Senior Member
Very useful!!

Thank you very much!

Regards,

Patrick Tahiri.
Previous Topic: Database conversion needed if migrating from 32-bit to 64-bit Oracle
Next Topic: database hang
Goto Forum:
  


Current Time: Fri Sep 20 10:36:03 CDT 2024