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

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

MS SQL

Posted Jan 24, 2000

TempDB Full Problems\Solutions

By Kevin Goodwyn

RESOLUTION OF TEMPDB PROBLEM #1

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.

PROBLEM

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.

METHOD 1 SOLUTION

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.

METHOD 2 SOLUTION

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