SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Unable to shrink tempdb


Unable to shrink tempdb

Author
Message
nitin.doshi
nitin.doshi
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

Group: General Forum Members
Points: 481 Visits: 432
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.
John Mitchell-245523
John Mitchell-245523
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32895 Visits: 16637
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
ESAT ERKEC
ESAT ERKEC
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1322 Visits: 988
Restart the engine tempdb drop and recreate it self
nitin.doshi
nitin.doshi
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

Group: General Forum Members
Points: 481 Visits: 432
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.
sanket kokane
sanket kokane
Right there with Babe
Right there with Babe (797 reputation)Right there with Babe (797 reputation)Right there with Babe (797 reputation)Right there with Babe (797 reputation)Right there with Babe (797 reputation)Right there with Babe (797 reputation)Right there with Babe (797 reputation)Right there with Babe (797 reputation)

Group: General Forum Members
Points: 797 Visits: 1022
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

-----------------------------------------------------------------------------
संकेत कोकणे
nitin.doshi
nitin.doshi
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

Group: General Forum Members
Points: 481 Visits: 432
75 GB is purely data file and size of log is 3.5 gb
Bhuvnesh
Bhuvnesh
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12554 Visits: 4077
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;-)
hs24
hs24
SSC Eights!
SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)

Group: General Forum Members
Points: 940 Visits: 374
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
GilaMonster
GilaMonster
SSC Guru
SSC Guru (211K reputation)SSC Guru (211K reputation)SSC Guru (211K reputation)SSC Guru (211K reputation)SSC Guru (211K reputation)SSC Guru (211K reputation)SSC Guru (211K reputation)SSC Guru (211K reputation)

Group: General Forum Members
Points: 211979 Visits: 46259
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, MVP, M.Sc (Comp Sci)
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


hs24
hs24
SSC Eights!
SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)SSC Eights! (940 reputation)

Group: General Forum Members
Points: 940 Visits: 374
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search