The "Shrink TempDb" commands are failed due to the "Truncate_Only is not a recognized backup option" error.
Any alternative or Is there any option for Shrink TempDB in Maintenance Plans of SQL server 2008 R2?Please help.
asked May 04 '12 at 10:32 AM in Default
The tempdb recovery is set to simple by default. You can't backup the log of a database in simple recovery. If you have out of control transactions, you'll need to deal with those transactions, then you can try using one of the shrink commands, either shrink database or [shrink file]. Truncate_only is part of a backup command, not a shrink.
By the way, constantly shrinking the database is a bad practice. If your database is constantly growing out to large sizes, the best practice is to identify the causes and eliminate or mitigate them, not just shrink the database on a nightly basis.: http://msdn.microsoft.com/en-us/library/ms189493.aspx
answered May 04 '12 at 10:55 AM
Grant Fritchey ♦♦
Looks like you have a maintenance plan which uses:
WITH TRUNCATE_ONLY was deprecated in SQL Server 2005 and removed in SQL Server 2008. The same thing can be achieved with
But Grant Fritchey's comment about not constantly shrinking tempdb-files is perfectly relevant.
answered May 04 '12 at 11:12 AM
Even after shrinking your tempdb, it may continue to grow if the auto growth is enabled and if you have uncontrolled transactions as said by @GrantFritchey. Rather than shrinking the tempdb, you have to work on these transactions that heavily utilize the tempdb( SQL Server profiler or the DMVs will help you to find these transactions). Get those queries analyze it and fine tune if possible. Other things to consider is the check for sort in tempdb in index rebuild process, this also contribute tempdb growth.
Query to find the session tempdb usage details.
answered May 04 '12 at 12:35 PM