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
305 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 13

Accepted Solution

by:
Nakul Vachhrajani earned 500 total points
ID: 40615011
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 9

Expert Comment

by:Tim Edwards
ID: 40615013
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:Scott Pletcher
ID: 40615032
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL replication over high latency link 10 58
Need help with T-SQL on SQL Server 2014 9 37
Download ms sql express. 2 25
SSMS Opening Mode 9 18
In this article I will describe the Backup & Restore 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.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

840 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