Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to best delete SQL Server 2005 errorlog Expand / Collapse
Author
Message
Posted Tuesday, August 12, 2008 9:13 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Sunday, October 5, 2014 12:35 PM
Points: 57, Visits: 135
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.


http://ozkary.blogspot.com
http://og-bit.com
Post #551101
Posted Tuesday, August 12, 2008 9:36 AM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 10:45 AM
Points: 4,064, Visits: 5,346
You won't hurt anything by deleting the old error log file and that's the only way to get rid of it.

Greg
Post #551134
Posted Tuesday, August 12, 2008 2:21 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, October 1, 2014 11:23 AM
Points: 414, Visits: 2,897
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



Post #551422
Posted Tuesday, August 12, 2008 3:34 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 10:45 AM
Points: 4,064, Visits: 5,346
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
Post #551468
Posted Wednesday, June 2, 2010 3:36 AM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, May 21, 2012 3:52 PM
Points: 14, Visits: 87
great help! Thanks guys!
Post #931193
Posted Wednesday, June 2, 2010 4:16 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Sunday, June 1, 2014 7:14 AM
Points: 10, Visits: 79
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


~RD
Post #931218
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse