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»»

TempDB Expand / Collapse
Author
Message
Posted Thursday, August 19, 2010 9:51 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Tuesday, July 23, 2013 6:34 AM
Points: 654, Visits: 265
Comments posted to this topic are about the item TempDB
Post #972269
Posted Friday, August 20, 2010 12:54 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, February 18, 2014 6:10 AM
Points: 350, Visits: 429
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
Post #972308
Posted Friday, August 20, 2010 12:55 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 3:35 PM
Points: 6,043, Visits: 8,324
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
Post #972311
Posted Friday, August 20, 2010 2:28 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:26 AM
Points: 1,780, Visits: 6,475
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.
Post #972360
Posted Friday, August 20, 2010 2:55 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 3:35 PM
Points: 6,043, Visits: 8,324
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
Post #972368
Posted Friday, August 20, 2010 3:22 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Saturday, March 29, 2014 11:41 AM
Points: 753, Visits: 133
SQL 2000, DBCC CHECKALLOC & DBCC CHECKCATALOG runs ok

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


Glen Parker
Post #972384
Posted Friday, August 20, 2010 6:38 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 9:16 AM
Points: 2,107, Visits: 2,114
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.
Post #972474
Posted Friday, August 20, 2010 7:13 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 7, 2014 2:36 PM
Points: 2,818, Visits: 2,565
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.
Post #972507
Posted Friday, August 20, 2010 8:06 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, July 17, 2014 10:56 AM
Points: 3,924, Visits: 1,607
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.
Post #972547
Posted Friday, August 20, 2010 9:56 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 10:30 AM
Points: 6,951, Visits: 7,065
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.



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

Anon.

Post #972655
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse