SQL Clone
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
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3046 Visits: 3637
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
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24813 Visits: 9730
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
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3046 Visits: 3637
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 Guru
SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)

Group: General Forum Members
Points: 92037 Visits: 45285
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
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3046 Visits: 3637
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 Guru
SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)

Group: General Forum Members
Points: 92037 Visits: 45285
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
Hall of Fame
Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)Hall of Fame (3K reputation)

Group: General Forum Members
Points: 3046 Visits: 3637
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 Guru
SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)SSC Guru (92K reputation)

Group: General Forum Members
Points: 92037 Visits: 45285
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
SSC-Addicted
SSC-Addicted (487 reputation)SSC-Addicted (487 reputation)SSC-Addicted (487 reputation)SSC-Addicted (487 reputation)SSC-Addicted (487 reputation)SSC-Addicted (487 reputation)SSC-Addicted (487 reputation)SSC-Addicted (487 reputation)

Group: General Forum Members
Points: 487 Visits: 1022
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
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1679 Visits: 2775
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