August 12, 2008 at 9:13 am
There was an outage on a SQL server 2005 server which created many errors. This caused the errorlog to grow too much. We have cycled the log file (sp_cycle_errorlog), so we have a new file. The problem is that we want to recover the disk space used by the previous file (errorlog.1). Apart from just deleting the file, what is the best way to delete this file to avoid causing any problems? We have already inspected the contents of the file.
thanks.
August 12, 2008 at 9:36 am
You won't hurt anything by deleting the old error log file and that's the only way to get rid of it.
Greg
August 12, 2008 at 2:21 pm
You should just be able to issue sp_cycle_errorlog until you reach you max set of saved logs, after that you can delete.
Andrew
August 12, 2008 at 3:34 pm
Actually, if you repeatedly execute sp_cycle_errorlog as Andrew suggests, you wouldn't have to delete the file at all. It would automatically drop off when you went past the configured max number of error logs.
Greg
June 2, 2010 at 3:36 am
great help! Thanks guys!
June 2, 2010 at 4:16 am
[font="Verdana"]There are couple of ways to do it.
1. Textbook Way- sp_cycle_errorlog - Closes the current error log file and cycles the error log extension numbers just like a server restart. The new error log contains version and copyright information and a line indicating that the new log has been created.
Ref.
http://msdn.microsoft.com/en-us/library/ms182512.aspx
2. Restart the SQL Services
3. Stop the Service - Rename The File - Restart the Service.
Enjoy SQL'ing[/font]
~RD
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply