Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Unable to shrink tempdb Expand / Collapse
Author
Message
Posted Tuesday, November 20, 2012 3:36 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, July 4, 2013 6:39 AM
Points: 363, Visits: 417
In one of our servers tempdb is grown to 75 gb. If we check properties of tempdb it is showing 73 gb free, but when we try to shrink tempdb it is giving below given error.... Has anybody faced similar issue and resolved..

Msg 5054, Level 16, State 1, Line 1
Could not cleanup worktable IAM chains to allow shrink or remove file operation. Please try again when tempdb is idle.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Post #1386793
Posted Tuesday, November 20, 2012 3:43 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 8:31 AM
Points: 5,369, Visits: 9,898
Have a look at this, and take notice of what it says in the section towards the end. Your safest bet is to restart the instance.

John
Post #1386800
Posted Tuesday, November 20, 2012 3:54 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 4:34 AM
Points: 231, Visits: 740
Restart the engine tempdb drop and recreate it self
Post #1386804
Posted Tuesday, November 20, 2012 3:54 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, July 4, 2013 6:39 AM
Points: 363, Visits: 417
Thanks John...

We I have already tried dbcc shrinkdatabase and shrinkfile and both are giving same error. This being our production server we are looking alternatives without restarting SQL service.
Post #1386806
Posted Tuesday, November 20, 2012 3:56 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, August 1, 2013 10:17 AM
Points: 323, Visits: 984
nitin.doshi (11/20/2012)
In one of our servers tempdb is grown to 75 gb. If we check properties of tempdb it is showing 73 gb free, but when we try to shrink tempdb it is giving below given error.... Has anybody faced similar issue and resolved..

Msg 5054, Level 16, State 1, Line 1
Could not cleanup worktable IAM chains to allow shrink or remove file operation. Please try again when tempdb is idle.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.



what is log file size of tempdb out of 75 GB


-----------------------------------------------------------------------------
संकेत कोकणे
Post #1386807
Posted Tuesday, November 20, 2012 4:03 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, July 4, 2013 6:39 AM
Points: 363, Visits: 417
75 GB is purely data file and size of log is 3.5 gb
Post #1386809
Posted Tuesday, November 20, 2012 4:30 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 19, 2014 12:26 AM
Points: 2,840, Visits: 3,963
can you post here, your databases configurations (their size ) ? additionally also check if there are any open transactions or not ? tempdb handles alot of stuff like temp table .temp valriable .order by grout by ..work table . index rebuils (sort in temp db ) etc etc etc .. so its natural that it grew upto its limits

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #1386825
Posted Tuesday, November 20, 2012 4:31 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, September 11, 2014 3:12 AM
Points: 851, Visits: 363
If you are trying to run a shrink on the tempdb you must be in single user mode and ensure no other activity is occurring in the tempdb database. If there is any activity on the tempdb then the DBCC SHRINKFILE and DBCC SHRINKDATABASE Commands shall fail.

If you are doing this you must ensure that you follow the recommendations from Microsoft located at http://support.microsoft.com/kb/307487

There is also a support article for SQL Server 2008 which states the same as the above support article, but I don't have it to hand
Post #1386826
Posted Tuesday, November 20, 2012 4:39 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 12:15 PM
Points: 43,017, Visits: 36,179
nitin.doshi (11/20/2012)
This being our production server we are looking alternatives without restarting SQL service.


Leave it as is?

If tempDB grew that size, then, unless there was some unusual activity, it suggests that TempDB needs to be that size and perhaps the initial size for the DB should be set closer to what it currently is.

As per the kb article posted earlier, shrinking an in-use TempDB can cause corruptions that will force a restart. The only safe way to shrink TempDB is to completely quiesce the server (no activity of any form), that usually means a restart.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1386832
Posted Tuesday, November 20, 2012 4:39 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, September 11, 2014 3:12 AM
Points: 851, Visits: 363
You also need to understand what is using tempdb. Shrinking the file may sort the problem sort term but does not mean this shall not happen again

SELECT TOP 10 session_id, database_id, user_objects_alloc_page_count + internal_objects_alloc_page_count / 129 AS tempdb_usage_MB
FROM sys.dm_db_session_space_usage
ORDER BY user_objects_alloc_page_count + internal_objects_alloc_page_count DESC;

The above query shall tell what is using tempdb.

Post #1386834
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse