SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


tempdb getting full


tempdb getting full

Author
Message
Sushant Yadav
Sushant Yadav
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1880 Visits: 876
My tempdb is getting full within 2 hours , there are some executing SP that are using temporary tables, cursors and joins , How can I troubleshoot the same, please help.
thanx in advance.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)

Group: General Forum Members
Points: 554756 Visits: 47749
Identify what is using lots of TempDB via the task_space_usage and session_space_usage DMVs, tune the offending queries to use less TempDB space.

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


Jack Vamvas
Jack Vamvas
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 Visits: 329
Common causes include insufficient memory, large temporary tables,large queries silling into TempDB. use queries on Monitor TempDB usage or if you want to list current TempDB statements - List Current TempDB statements

Work on optimizing the queries

Jack Vamvas
sqlserver-dba.com
arnipetursson
arnipetursson
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3603 Visits: 1019
SQL Addict (5/20/2013)
My tempdb is getting full within 2 hours , there are some executing SP that are using temporary tables, cursors and joins , How can I troubleshoot the same, please help.
thanx in advance.


How big is your tempdb in relation to the databases (and their largest tables) on your instance?
Sushant Yadav
Sushant Yadav
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1880 Visits: 876
I have identified the stored procedures which are causing increase in tempdb size , procedures are using cursors and creating huge temp tables, what should I do to avoid this?

thanks in advance...
Sushant Yadav
Sushant Yadav
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1880 Visits: 876
I have identified the stored procedures which are causing increase in tempdb size , procedures are using cursors and creating huge temp tables, what should I do to avoid this?

thanks in advance...
GilaMonster
GilaMonster
SSC Guru
SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)

Group: General Forum Members
Points: 554756 Visits: 47749
Work through the procedures, see if you can rewrite them not to use cursors and temp tables.

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


Jack Vamvas
Jack Vamvas
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 Visits: 329
Are you receiving any Sort warnings? these can be a clue of ORDER BY spilling into TempDB and insufficient memory. Check Statistics are up to date

Jack Vamvas
sqlserver-dba.com
GilaMonster
GilaMonster
SSC Guru
SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)

Group: General Forum Members
Points: 554756 Visits: 47749
Jack Vamvas (5/23/2013)
Are you receiving any Sort warnings? these can be a clue of ORDER BY spilling into TempDB and insufficient memory. Check Statistics are up to date


Sorts are very prone to spilling even if everything's correct in terms of stats and there's tonnes of memory. It's because of the size of the memory required to do the sort, while SQL may well have enough memory, it's not likely to toss lots of stuff out of the buffer pool just so that one process can have a few GB of workspace memory for a sort

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


Jack Vamvas
Jack Vamvas
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 Visits: 329
When I see Sort warnings - I check a) Statistics are up to date b) Consider Query Tuning

Jack Vamvas
sqlserver-dba.com
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