Sql Server Error Messages : The transaction log for database ‘tempdb’ is full due to ‘ACTIVE_TRANSACTION’
- Posted by Sqltimes
- On July 5, 2014
- 0 Comments
Quick one today: Earlier last week, I was playing with one of our customer databases in our lab environment. As part of implementing table partitioning, some tables changes were necessary; Moving data from one set of tables to another. In the middle of running those scripts, this error occurred:
Msg 1105, Level 17, State 2, Line 1 Could not allocate space for object 'dbo.SORT temporary run storage: 140751663071232' in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup. Msg 9002, Level 17, State 4, Line 1 The transaction log for database 'tempdb' is full due to 'ACTIVE_TRANSACTION'.
All the heavy data movement, between tables and reindexing, has incurred a lot of growth in the transactional log file of the user database; And equivalent growth in the data/log files of tempdb. So, we took the following steps to rectify it: As the script took a few hours to execute and complete all the data movement. We did the following steps, every few minutes:
- Issue CHECKPOINT on the tempdb
1
2
3
4
|
USE tempdb GO CHECKPOINT GO |
- Take Transactional log backup on the user database
1
2
3
|
BACKUP LOG CustomerXS TO DISK = N 'M:\MSSQL\Backup\MSSQLSERVER\XS and RT\XS_Movement.trn' WITH COMPRESSION GO |
This allowed us to create more free space in the database files to accommodate space for new activity.
Hope this helps,
_Sqltimes
0 Comments