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


TempDB


TempDB

Author
Message
VM-723206
VM-723206
SSC Eights!
SSC Eights! (824 reputation)SSC Eights! (824 reputation)SSC Eights! (824 reputation)SSC Eights! (824 reputation)SSC Eights! (824 reputation)SSC Eights! (824 reputation)SSC Eights! (824 reputation)SSC Eights! (824 reputation)

Group: General Forum Members
Points: 824 Visits: 267
Comments posted to this topic are about the item TempDB
COOL_ICE
COOL_ICE
SSC-Addicted
SSC-Addicted (470 reputation)SSC-Addicted (470 reputation)SSC-Addicted (470 reputation)SSC-Addicted (470 reputation)SSC-Addicted (470 reputation)SSC-Addicted (470 reputation)SSC-Addicted (470 reputation)SSC-Addicted (470 reputation)

Group: General Forum Members
Points: 470 Visits: 431
Basic question, but still good one.

- SAMJI
If you marry one they will fight with you, If you marry 2 they will fight for you :-)
Hugo Kornelis
Hugo Kornelis
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13177 Visits: 12179
I got it right, but it was a coinflip. You can actually run DBCC CHECKALLOC and DBCC CHECKCATALOG on tempdb. You will not get an error, but on the other hand, nothing will actually be done.

Even Books Online seems unsure about this subject. The reference given in the explanation does indeed state that these commands can't be run on tempdb. But the topics on DBCC CHECKALLOC and DBCC CHECKCATALOG themselves say it can be run - this is the exact quote from DBCC CHECKALLOC (http://msdn.microsoft.com/en-us/library/ms188422.aspx):
"Note

In SQL Server 2005 and later, running DBCC CHECKALLOC against tempdb does not perform any checks. This is because, for performance reasons, database snapshots are not available on tempdb. This means that the required transactional consistency cannot be obtained. Stop and start the MSSQLSERVER service to resolve any tempdb allocation issues. This action drops and re-creates the tempdb database."
The DBCC CHECKCATALOG topic (http://msdn.microsoft.com/en-us/library/ms186720.aspx) has a similar note.
To me, this says that you can run the command. But nothing will happen.

When deciding whether the author of this question intended to ask if we can execute the command on tempdb and not get an error (yes, we can), or if we can get SQL Server to actually perform the checks that these DBCC commands do on tempdb (no, we can't), I went with the latter.

(Steps aside and makes room for the angry comments by those who picked the other option and now "want their point back")


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Toreador
Toreador
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3122 Visits: 8088
Hugo Kornelis (8/20/2010)You can actually run DBCC CHECKALLOC and DBCC CHECKCATALOG on tempdb. You will not get an error, but on the other hand, nothing will actually be done.


Which version is that on? With 2008 I get

The check statement was aborted. DBCC CHECKALLOC cannot be run on TEMPDB.
The check statement was aborted. DBCC CHECKCATALOG cannot be run on TEMPDB.
Hugo Kornelis
Hugo Kornelis
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13177 Visits: 12179
Toreador (8/20/2010)
Hugo Kornelis (8/20/2010)You can actually run DBCC CHECKALLOC and DBCC CHECKCATALOG on tempdb. You will not get an error, but on the other hand, nothing will actually be done.


Which version is that on? With 2008 I get

The check statement was aborted. DBCC CHECKALLOC cannot be run on TEMPDB.
The check statement was aborted. DBCC CHECKCATALOG cannot be run on TEMPDB.

I get the same message (SQL 2005). But those are informational messages, not error messages.
BEGIN TRY;
DBCC CHECKALLOC (tempdb);
DBCC CHECKCATALOG (tempdb);
PRINT 'No errors';
END TRY
BEGIN CATCH;
PRINT 'Error';
END CATCH;


The check statement was aborted. DBCC CHECKALLOC cannot be run on TEMPDB.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
The check statement was aborted. DBCC CHECKCATALOG cannot be run on TEMPDB.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
No errors

So you can not get SQL Server to check allocation or catalog in tempdb, but you can run these commands. Hairsplitting, I know - but when I answered the question, I found mysself wondering what interpretation the author would use.


Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
GlenParker
GlenParker
Right there with Babe
Right there with Babe (781 reputation)Right there with Babe (781 reputation)Right there with Babe (781 reputation)Right there with Babe (781 reputation)Right there with Babe (781 reputation)Right there with Babe (781 reputation)Right there with Babe (781 reputation)Right there with Babe (781 reputation)

Group: General Forum Members
Points: 781 Visits: 133
SQL 2000, DBCC CHECKALLOC & DBCC CHECKCATALOG runs ok

Mis-read the 'Perform' in the question and missed the right choice.

Glen Parker :-)
Dave62
Dave62
Hall of Fame
Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)Hall of Fame (3.4K reputation)

Group: General Forum Members
Points: 3350 Visits: 2796
I guess if we really want to split hairs and get technical, it is possible to drop tempdb. Stopping and starting the SQLService or rebooting the server will result in tempdb being dropped and recreated.
Daniel Bowlin
Daniel Bowlin
SSCarpal Tunnel
SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)

Group: General Forum Members
Points: 4770 Visits: 2629
Great question....I am not a DBA and this is sort of a DBA question. That is why I love QoTD. It makes me explore areas that are not in my primary skill set or a part of my daily concern.
SanjayAttray
SanjayAttray
SSCarpal Tunnel
SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)SSCarpal Tunnel (4.7K reputation)

Group: General Forum Members
Points: 4727 Visits: 1619
Was sure about other three answers but not sure about

Running DBCC CHECKALLOC or DBCC CHECKCATALOG

I executed them on all SQL Server versions and it could be executed successfully on SQL Server 6.5, SQL Server 7 and SQL Server 2000.

But 2005 and 2008 throws error.

The check statement was aborted. DBCC CHECKCATALOG cannot be run on TEMPDB.
The check statement was aborted. DBCC CHECKALLOC cannot be run on TEMPDB.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

SQL DBA.
David Burrows
David Burrows
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11247 Visits: 9888
Hugo Kornelis (8/20/2010)
(Steps aside and makes room for the angry comments by those who picked the other option and now "want their point back")


Nope. No angry comment :-)

It is how you interpret 'performed'. On SQL2K it performs and produces output, which may indicate it did nothing but it still performed in a way.

Oh well, C'est la vie. :-D


Far away is close at hand in the images of elsewhere.

Anon.


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