Tempdb is full in primary node SQL server 2012 sharepoint database including three node cluster with Always on

Ken 21 Reputation points
2022-06-07T23:13:09.1+00:00

Hi,
My primary db tempdb got fulled after we did failover and restart of all 3-nodes cluster. The issue started 2 days after we performed servers reboots of 3-node cluster.
I've check few things:

Select
SUM (user_object_reserved_page_count)*8 as user_objects_kb,
SUM (internal_object_reserved_page_count)*8 as internal_objects_kb,
SUM (version_store_reserved_page_count)*8 as version_store_kb,
SUM (unallocated_extent_page_count)*8 as freespace_kb
From sys.dm_db_file_space_usage
Where database_id = 2

user_objects_kb internal_objects_kb version_store_kb freespace_kb
1559616 22528 128 48739840

Also. check size of each tempfiles,

USE [tempdb]
SELECT
[name]
,CONVERT(NUMERIC(10,2),ROUND([size]/128.,2)) AS [Size]
,CONVERT(NUMERIC(10,2),ROUND(FILEPROPERTY([name],'SpaceUsed')/128.,2)) AS [Used]
,CONVERT(NUMERIC(10,2),ROUND(([size]-FILEPROPERTY([name],'SpaceUsed'))/128.,2)) AS [Unused]
FROM [sys].[database_files]

name Size Used Unused
tempdev 12288.00 389.13 11898.88
templog 62298.69 61722.09 576.60
tempdbdev1 12288.00 387.13 11900.88
tempdbdev2 12288.00 388.38 11899.63
tempdbdev3 12288.00 386.06 11901.94

Above query, I can see we have unused space left. Is it okay to add some more space to tempdb drive?
Also, tempdb is in simple model, still we have growth issue.

Can you please help me to fix the growth issue.

Regards,
Ken

Windows for business | Windows Server | Storage high availability | Clustering and high availability
SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 128.7K Reputation points MVP Volunteer Moderator
    2022-06-08T21:40:01.257+00:00

    Above query, I can see we have unused space left. Is it okay to add some more space to tempdb drive?

    I guess that as long as there is space available on the drive, there's nothing wrong with that.

    After all, given the price of hardware, it is often cheaper to just add disk, than spending precious human time to figure out where the space goes.


  2. Erland Sommarskog 128.7K Reputation points MVP Volunteer Moderator
    2022-06-09T20:20:42.973+00:00

    I didn't pay attention to that it is the log file of tempdb that is exploding, but looked at the data files-

    If the log file keeps growing, the most likely reason is that there is an uncommitted transaction which prevents truncation of the log file. Run this_:

       USE tempdb  
       go  
       DBCC OPENTRAN  
    

    If this lists a spid, try to find it see what it is up to. Or just kill it. Keep doing this until DBCC OPENTRAN reports there are no processes or only report current processes. Then you can try shrinking the log file.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.