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»»

Tempdb grows suddenly. Expand / Collapse
Author
Message
Posted Thursday, August 29, 2013 3:50 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 2, 2013 5:19 AM
Points: 2, Visits: 7
Hi

I know that TempDB grows if it needs and if you restart the sql server the TempDB resets to it's configured size.

On a sql server we have i have never had any problem with TempDB.
The size has always been about 2 GB.
I have run many big querys against it and it have never grown.
Every week a rebuild index is being run on the databas that is about 40GB.

But suddenly , the size jump up to 24 GB on the TempDB.
I restart the server and everything is normal.
But then over a night the size jump up to 42 GB.
And during that time the only thing that has happen is the same thing that
has happend every night.

If i run:
SELECT SUM(unallocated_extent_page_count) AS [free pages],
(SUM(unallocated_extent_page_count)*1.0/128) AS [free space in MB]
FROM sys.dm_db_file_space_usage;

It says that about 40 GB is free space in TempDB.

I am very confused.

What should i do ?



Post #1489622
Posted Thursday, August 29, 2013 4:42 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
Every week a rebuild index is being run on the databas that is about 40GB.

Is this running with SORT_IN_TEMPDB ON?

But then over a night the size jump up to 42 GB.
And during that time the only thing that has happen is the same thing that
has happend every night.


Are you talking about rebuild index or some other activity, can you specify.


Regards
Durai Nagarajan
Post #1489639
Posted Thursday, August 29, 2013 4:43 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Wednesday, September 24, 2014 5:37 AM
Points: 498, Visits: 1,845
Wrong thread!
Post #1489641
Posted Thursday, August 29, 2013 4:55 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
Beatrix Kiddo (8/29/2013)
Wrong thread!


Why?


Regards
Durai Nagarajan
Post #1489643
Posted Thursday, August 29, 2013 7:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, September 2, 2013 5:19 AM
Points: 2, Visits: 7
Hi

The "sort results in TempDB" is off.

During the night the only activity is backup and some calculation.
But nothing off this is a new activity.

Rebuild index runs only ones a week on sundays.
Post #1489698
Posted Thursday, August 29, 2013 7:17 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 3:55 AM
Points: 519, Visits: 223
put a server side trace on the DB to see what is running overnight to impact the TempDB. If its happening everynight then you'll only need to do it for a day or two to locate the culprit.
Post #1489706
Posted Thursday, August 29, 2013 7:48 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
what is that some calculation and is that log grows after this or during this ?

Regards
Durai Nagarajan
Post #1489725
Posted Thursday, August 29, 2013 8:20 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 5:01 AM
Points: 2,005, Visits: 3,413
You might be able to get the information from the default trace:

DECLARE @tracefile nvarchar(1000)
SELECT @tracefile = CAST(value AS NVARCHAR(1000)) FROM ::fn_trace_getinfo(0) where traceid = 1 and property = 2;

PRINT @tracefile


SELECT gt.HostName,
gt.ApplicationName,
gt.LoginName,
gt.Duration/1000 AS [Duration (ms)],
gt.StartTime,
gt.DatabaseName,
gt.[FileName],
gt.IsSystem,
te.name,
CAST(gt.IntegerData*8 AS FLOAT)/1024 AS [MB Growth]
FROM fn_trace_gettable(@tracefile, default) gt
INNER JOIN sys.trace_events te ON te.trace_event_id = gt.eventclass
WHERE te.category_id = 2
ORDER BY gt.StartTime DESC
GO

Post #1489745
Posted Thursday, August 29, 2013 8:31 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, October 17, 2014 7:33 AM
Points: 99, Visits: 579
Run this...

select * from sys.dm_db_task_space_usage
where internal_objects_alloc_page_count <> 0

See which spid has an high 'internal_objects_alloc_page_count'
and a low 'internal_objects_dealloc_page_count'

then see what these spids are doing.

Do you use Service Broker at all.
Post #1489751
Posted Thursday, August 29, 2013 8:46 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, October 16, 2014 6:18 PM
Points: 3,952, Visits: 7,170
The trace option is probably a good place to start in finding your culprit (my preferred method) - although i'd probably create a custom trace in profiler say tracking only items that had a lengthy duration or high logical reads...

I also wanted to ask: Does this server have Reporting Services installed? If so, you may want to check and see if someone has scheduled a report to run during the night. If so, depending on the query/procedure used in the report it might be the cause of the sudden spike in TempDB

Just a shot in the dark, but may be worth a look


______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience"
Post #1489760
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse