Rolling SQL Server Error Logs WITHOUT Rebooting
This is a bit in reverse as the code will be above the rant today. 😉
To roll SQL Server Error Logs, in 2000 and higher, a reboot isn’t necessary.
Simply open up the Management Console (or Query Analyzer) and attach to the Master database. From there, execute the built-in stored procedure ‘sp_cycle_errorlog’.
This will roll your current ERRORLOG file along, according to the configuration settings you’ve specified. The current log will be renamed ERRORLOG.#.
We had a… discussion… earlier today between the department I work in and another regarding the virtues of uptime and keeping servers available.
The paradigm is to reboot a server when something happens—no matter what. Troubleshoot? Nah. Diagnose? No way. Just kick it and pray it works. Why? Because that’s how Windows works.
Now, I agree with that 100%. That is how Windows works. I do that at home. If my home computer starts being stupid, I’ll reboot it as a first step and go from there.
But, my home computer isn’t in a production environment with thousands of users (that I’m aware of).
There’s a big different there.