SQL Server logs

  • How long does SQL 7.0/2000 retain the SQL server logs? Is there a need/way to delete the oldest or does SQL manage this for us?

    Terry Crosby


    Terry

  • The answer is it depends. Depending on how you set the recovery mode determines how much work you have to put into logs. I recommend full recovery mode, which means you'll need to do periodic transaction log backups. Before we get too deep into that, maybe you add some info about what you would like to accomplish?

    Andy

  • Actually, I'm not refering to transaction logs. I have my production db set to full recovery and dump the transaction logs hourly. I'm refering to the history logs, if you will. (off of EM, management->SQL Server logs). We've installed SQL Server to the c:\ partition and as disk gets used up, does SQL overlay, or retain, the history. With event viewer at the server level, you can set it to overwrite event history as needed. Does SQL server retain, say forty days, and then overlay the oldest history? Or does it continue to grow and we have to be proactive and cleanup old history files periodically?? In enterprise manager I see Current and 6 archives, dating back eight or nine months.

    Hope this helps clarify my question a little better.

    Terry Crosby


    Terry

  • You can configure the number of error logs. It keeps growing until you restart the service or use sp_cycle_errorlog. I set a job to cycle it daily at midnight, keeps the file size small and easy to view. Up to you how long/how many you keep, I don't see that they hold much value beyond a few days. If an error occurs you normally research it right away, or within a few days if you're on vacation, long weekend, etc.

    Andy

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply