Solved

Transaction log is full for the ASP state db.  How do I shrink or delete the transaction log?

Posted on 2015-02-17
3
263 Views
Last Modified: 2015-05-19
The transaction log for database 'ASPState' is full due to 'ACTIVE_TRANSACTION'. My production website is down because of this error. My database is on SQL server 2014. How do I shrink or clear the transaction log Please help.
0
Comment
Question by:TrialUser
3 Comments
 
LVL 11

Accepted Solution

by:
Nakul Vachhrajani earned 500 total points
Comment Utility
Unless the active transaction is not complete, the transaction log will not be freed up.

The 1st thing will be to figure out which is this long running transaction and either COMMIT or ROLLBACK the same.
Once done, take a log backup and you should be all set (if the database is in a Bulk-logged or FULL recovery mode).
0
 
LVL 8

Expert Comment

by:Tim Edwards
Comment Utility
You will want to create a maintenance schedule for the database that will do the backup of the database and logs, once you can have this setup and run successfully the transaction logs will truncate

Here is the technet article for backing up SQL 2014, please review in adjust to meet your needs.

https://msdn.microsoft.com/en-us/library/ms179478.aspx
0
 
LVL 69

Expert Comment

by:ScottPletcher
Comment Utility
Given that your website is down, I would go into emergency mode and first just get it running.  We can, and should and will, worry about other related issues later.

Run these commands, then report the log file total size and the % free.

USE ASPState
ALTER DATABASE ASPState SET RECOVERY SIMPLE;
CHECKPOINT
WAITFOR DELAY '00:01:00'
CHECKPOINT

EXEC sp_helpfile
DBCC SQLPERF ( LOGSPACE )


If the log file is (very) large, run this command too to see how many VLFs you have:
DBCC LOGINFO
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
The duplicate key value is (<NULL>) 14 43
SQL Script to find duplicates 16 18
Sql query 34 16
SQL Split character from numbers 3 16
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now