Home » RDBMS Server » Server Administration » Manage alertSID.log (Any Oracle under solaris)
icon5.gif  Manage alertSID.log [message #315511] Mon, 21 April 2008 15:33 Go to next message
thorin666
Messages: 144
Registered: March 2007
Senior Member
I am trying to manage my alert cause is growing and i am trying to make a cron script to delete from alert.log the records older than 14 months
anyone know how to do a cat using sysdate and delete the records older than that date?

i don't know if i was clear but as for example
today is 21-apr-2008
i want to erase every record from the alert older than 21-feb-2007

have anyone any idea about how to do it?
thank you in advance
Re: Manage alertSID.log [message #315513 is a reply to message #315511] Mon, 21 April 2008 15:42 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
What about just deleting the first {put your number here} number of lines when the file reaches {put you next number here} number of lines?
Re: Manage alertSID.log [message #315514 is a reply to message #315513] Mon, 21 April 2008 15:45 Go to previous messageGo to next message
thorin666
Messages: 144
Registered: March 2007
Senior Member
joy_division wrote on Mon, 21 April 2008 15:42
What about just deleting the first {put your number here} number of lines when the file reaches {put you next number here} number of lines?


i don't think that is a good idea... cause i don't know how many lines the alert will grow in 1 month
my idea is to put the script in a cron that run every 1 of each month

thank you for your idea anyway Very Happy
Re: Manage alertSID.log [message #315522 is a reply to message #315511] Mon, 21 April 2008 17:24 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
I was always taught to use the best tool for the job.

If you insist on using a hammer to make 2 pieces of lumber from 1 original piece of lumber, nobody can stop you from doing so.

What I do is at 00:00 on the 1st of every month a script runs
NOW=`date %Y%m`
lnsrctl stop
mv listener.log listener-${NOW}.log
lsnrctl start

You can use "find" to clean old log files you deem unnecessary.
Re: Manage alertSID.log [message #315778 is a reply to message #315511] Tue, 22 April 2008 14:42 Go to previous message
dzt52r
Messages: 19
Registered: July 2007
Location: PA
Junior Member
it's tough to recommend the best way when you don't say what you are running ( windows, unix, linux, ?). I run on solaris. I use a freeware program I got from sun freeware, logrotate. Install and configure. It is very straight forward and very easy to configure and run. A scheduled job is run daily. It handles a lot more than just my alert and listener logs.
Previous Topic: ora-01008 not all variables bound
Next Topic: Data movement from one partition to another
Goto Forum:
  


Current Time: Fri Nov 29 21:54:33 CST 2024