Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Tempgb log - not able to shrink....none of the queries are helping


Tempgb log - not able to shrink....none of the queries are helping

Author
Message
curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
I have gone through many many different forums in trying to identify my tempdb issues. None of the queries are giving me the data i want. Basically at the moment my tempdb log file is 38 gb, after i run all the queries from different forums i see ONLY 300 MB being used in tempdb. I am still lost and have these questions:

i) Do the DMV's consider log file usage/capacity at all or is it just data file?

ii) Can someone please provide me with a query which will tell me which spid has used up all the tempdb data and log file.


Thanks
GSquared
GSquared
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14375 Visits: 9729
sp_who2 should tell you which SPIDs are active in tempdb. Can use the Management Studio activity monitor (right-click the server name in the object explorer if you haven't use that tool before), but that can be a pain since it updates constantly.

DBCC SQLPERF(LOGSPACE) should tell you how much log space is being used.

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
GSquared (10/30/2012)
sp_who2 should tell you which SPIDs are active in tempdb. Can use the Management Studio activity monitor (right-click the server name in the object explorer if you haven't use that tool before), but that can be a pain since it updates constantly.

DBCC SQLPERF(LOGSPACE) should tell you how much log space is being used.


I see that ONLY 25% is being used. I did try to take with backup with truncate_only option and then shrink,still log file shows 38 gb.?
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47206 Visits: 44367
TempDB is in simple recovery model, Backup log with truncate_only does nothing to a DB in simple recovery.

When shrinking a log file, you can't shrink past the active portion of the log. If that's right at the end of the file, you'll need to wait until it cycles around to shrink the log.

p.s. Why are you shrinking the log anyway?


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
GilaMonster (10/30/2012)
TempDB is in simple recovery model, Backup log with truncate_only does nothing to a DB in simple recovery.

When shrinking a log file, you can't shrink past the active portion of the log. If that's right at the end of the file, you'll need to wait until it cycles around to shrink the log.

p.s. Why are you shrinking the log anyway?



Thanks. What do u mean by " If that's right at the end of the file, you'll need to wait until it cycles around to shrink the log."

I am curious to see that why is my tempdblog 40gb, basically my end goal is to find the process which is causing it to grow such big
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47206 Visits: 44367
The log is a circular file, SQL writes log records until it reaches the end of the file, then cycles round and starts reusing the file from the beginning.
Managing Transaction Logs
http://www.sqlservercentral.com/articles/Transaction+Log/72488/

If you want to see what's using the log, put some monitoring in place, don't shrink it and force it to grow again.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


curious_sqldba
curious_sqldba
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1543 Visits: 3573
GilaMonster (10/30/2012)
The log is a circular file, SQL writes log records until it reaches the end of the file, then cycles round and starts reusing the file from the beginning.
Managing Transaction Logs
http://www.sqlservercentral.com/articles/Transaction+Log/72488/

If you want to see what's using the log, put some monitoring in place, don't shrink it and force it to grow again.


I guess at the moment i wanted to know why can't i shrink my logfile, what is holding up. Any query that can tell me this?
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47206 Visits: 44367
DBCC LOGINFO

If the active portion of the log is at the end of the file (or near the end) you will not be able to shrink because nothing can move log records and shrink can only remove space that's after the active portion of the log


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


sanket kokane
sanket kokane
Old Hand
Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)Old Hand (331 reputation)

Group: General Forum Members
Points: 331 Visits: 1019
you can restrict the tempdb log file size ,so that it will stop growing and log file will get reuse .
and then you can try to shrink .

also restarting the sql server service can help you ...but I will never recommend for it ;-)

-----------------------------------------------------------------------------
संकेत कोकणे
durai nagarajan
durai nagarajan
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1107 Visits: 2771
sanket kokane (10/31/2012)
you can restrict the tempdb log file size ,so that it will stop growing and log file will get reuse .
and then you can try to shrink .

also restarting the sql server service can help you ...but I will never recommend for it ;-)



restarting sql server will help and how about closing/droping all the temp objects after its use is over.

but restricting tempdb size might also cause the query related to tempdb to wait for resources incase other resource still want the tempdb space.

Regards
Durai Nagarajan
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