Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Tempgb log - not able to shrink....none of the queries are helping Expand / Collapse
Author
Message
Posted Tuesday, October 30, 2012 12:42 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 7:08 AM
Points: 1,283, Visits: 2,958


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
Post #1378965
Posted Tuesday, October 30, 2012 12:54 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Friday, June 27, 2014 12:43 PM
Points: 15,444, Visits: 9,596
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
Post #1378970
Posted Tuesday, October 30, 2012 1:14 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 7:08 AM
Points: 1,283, Visits: 2,958
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.?
Post #1378987
Posted Tuesday, October 30, 2012 1:27 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:26 AM
Points: 42,763, Visits: 35,856
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 2008, MVP
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

Post #1378992
Posted Tuesday, October 30, 2012 1:38 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 7:08 AM
Points: 1,283, Visits: 2,958
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
Post #1378997
Posted Tuesday, October 30, 2012 2:10 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:26 AM
Points: 42,763, Visits: 35,856
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 2008, MVP
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

Post #1379014
Posted Tuesday, October 30, 2012 2:16 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 7:08 AM
Points: 1,283, Visits: 2,958
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?
Post #1379016
Posted Tuesday, October 30, 2012 2:31 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:26 AM
Points: 42,763, Visits: 35,856
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 2008, MVP
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

Post #1379028
Posted Wednesday, October 31, 2012 6:11 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, August 1, 2013 10:17 AM
Points: 323, Visits: 984
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



-----------------------------------------------------------------------------
संकेत कोकणे
Post #1379270
Posted Wednesday, October 31, 2012 6:50 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, May 30, 2014 8:15 AM
Points: 1,056, Visits: 2,687
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
Post #1379285
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse