Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
» Sitemap
Free Newsletters:

By submitting your information, you agree that databasejournal.com may send you databasejournal offers via email, phone and text message, as well as email offers about other products and services that databasejournal believes may be of interest to you. databasejournal will process your information in accordance with the Quinstreet Privacy Policy.

News Via RSS Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles


Posted Jan 25, 2000

TempDB Full Problems\Solutions

By Kevin Goodwyn


The tempdb is used for creating temporary tables or storing temporary information. For example, a temporary table in a stored procedure or sql statement may create a temporary work table as a result of a query with a 'group by' or 'order by' clause.


My SQL Server (6.5) had Tempdb set to 400 MB and a Tempdb Log set to 100 MB. It also had devices of similar sizes. For my requirements this was a lot of wasted space.  Therefore, I decided to shrink Tempdb using two methods of which only one worked.


1.  Set the database to 'single user' mode.

2.  Execute the dbcc shrinkdb command or click the shrink db button. This produced the following message:

"Attempt to set 'tempdb' database to single user mode failed because the usage count is three. Make sure that no other users are currently using the database."

I then executed the 'sp_who active' command which indicated that the usage count was three because of internal sql server processes running. These internal processes were Mirror Handler, Lazy Writer, Checkpoint Sleep, etc. These processes can not be killed.   (I was not able to kill them).  Therefore, I performed Method 2.


1.  Put a modest size Tempdb into RAM (sp_configure 'temp', 10).

2.  Stop/Start the Server.

3.  Drop the devices that were being used for Tempdb.

4.  Make sure Master is the default device.

5.  Remove Tempdb out of RAM (sp_configure 'temp', 0).

6.  Stop/Start the Server. And boooom! Tempdb was placed on the Master device with a more reasonable size of 2 MB (default).

MS SQL Archives

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Latest Forum Threads
MS SQL Forum
Topic By Replies Updated
SQL 2005: SSIS: Error using SQL Server credentials poverty 3 August 17th, 07:43 AM
Need help changing table contents nkawtg 1 August 17th, 03:02 AM
SQL Server Memory confifuration bhosalenarayan 2 August 14th, 05:33 AM
SQL Server Primary Key and a Unique Key katty.jonh 2 July 25th, 10:36 AM