Solved

unable to shrink tempdb data file in single user mode

Posted on 2011-09-08
6
628 Views
Last Modified: 2012-05-12
select @@spid
union
select spid from sys.sysprocesses where dbid = 2

gives me only one row.. (the session is the only user in tempdb)

still the below does not shrink it. why? what could be blocking it, since there is no other spid that is keeping a hold on it?

dbcc shrinkfile (1,10240)
0
Comment
Question by:25112
  • 3
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
dbaSQL earned 167 total points
ID: 36507500
0
 
LVL 5

Author Comment

by:25112
ID: 36507530
in that link, Method 2 & 3 do not avail any help. i am hoping to avoid Method 1.

if I am the only spid, why would there any hindrance to shrink it?
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 333 total points
ID: 36514840
You need to restart the SQL Server service and it will initialize tempdb to whatever setting you had configured.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Author Comment

by:25112
ID: 36516865
i had told management that i will have to restart sql service after off-hours..

but now, when i ran dbcc shrinkfile (1,10240) again, it worked fine.. (it shrank it).. could there be processes not seeing in sysprocesses that could be holding tempdb, and when it is released it works ok to shrink?
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 333 total points
ID: 36517172
>>could there be processes not seeing in sysprocesses that could be holding tempdb, and when it is released it works ok to shrink? <<
Yes.
0
 
LVL 5

Author Comment

by:25112
ID: 36517499
good to know..
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question