HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

ASPState Log file growing tremendously - SQL Server 2008

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
file2008logsqlaspstatetremendouslygrowingserver

Problem

Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (X64) Web Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1)

I have an ASPState database online, and its log file ASPState_log is growing tremendously. The current size is 536gb.

How can I maintain this log file?

I take a daily backups through SQL Agent job. Can I truncate the logs?

What is the best practice to keep the log file size in control?

Solution

99% of the time, the asp.net session state database does not warrant FULL recovery and transaction log backups. In fact, it usually doesn't warrant any backups at all. I'd favour a script to recreate it over taking backups.

NB: Be wary of folk sneaking persistent objects in to your state database. Lock 'em out.

If your SQL Server isn't clustered, you have the option of targeting tempdb for state storage as an alternative to a persistent database, so it's treated as truly disposable.

Assuming your usage is typical and recovery of the data isn't required either:

  • Switch to SIMPLE recovery model.



  • Follow Kimberly Tripp's suggested route for shrinking the log.



Or, if you aren't clustered go the tempdb route and drop your state database, by re-running aspnet_regsql with the option -sstype t.

Context

StackExchange Database Administrators Q#29805, answer score: 9

Revisions (0)

No revisions yet.