Wednesday, February 15, 2012

Could not allocate new page for database 'TEMPDB'. There are no more pages available in filegroup DEFAULT. Space can be created by dropping objects, adding additional files, or allowing file growth.
Server: Msg 1101, Level 17, State 10, Line 1 

Or

The transaction log for database 'tempdb' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

The above message indicates that there is no more free space available in TEMPDB and no more pages can be allocated. If you see this message then check the AUTOGROW property for TEMPDB.

Ensure that the AUTOGROW property is enabled and check the MAXIMUM FILE Size of the data or log file can be.

Verify if this is set to an unrestricted growth or not. If yes, then check the disk where the data file resides and confirm that it has enough space.


If no then you have to increase the max size of the data or log file.  There is no reason to restrict the size of TEMPDB since the running queries will determine the required size of TEMPDB.

If you have reached the maximum capacity on the disk where the data/log files reside then add a new data or log file to TEMPDB on a different drive using the following SQL.

USE [master]
GO
ALTER DATABASE [tempdb] ADD FILE ( NAME = N'tempdev2', FILENAME = N'E:\DataDir\tempdb_date2.mdf' , SIZE = 1048576KB , FILEGROWTH = 10%)
GO

In order to prevent this in the future if you want to move TEMPD to a different drive then move the TEMPDB using the following commands. This will require a SQL Server restart to take effect.

USE master
GO
ALTER DATABASE TempDB MODIFY FILE
(NAME = tempdev, FILENAME = 'C:\DataDir\tempDev.mdf')
GO
ALTER DATABASE TempDB MODIFY FILE
(NAME = templog, FILENAME = 'C:\LogDir\templog.ldf')
GO 

No comments:

Post a Comment