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


How to find the root cause of tempdb log file increasing


How to find the root cause of tempdb log file increasing

Author
Message
Wison
Wison
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 151
Hi all,
I found the tempdb log file size of one instance increased to 200 GB.
how can i get the root cause of the issue?

any answer is appreciated.

thanks.
Eirikur Eiriksson
Eirikur Eiriksson
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39625 Visits: 19440
Wison (8/22/2014)
Hi all,
I found the tempdb log file size of one instance increased to 200 GB.
how can i get the root cause of the issue?

any answer is appreciated.

thanks.


Quick suggestion, look into sys.dm_tran_* dynamic management views. There are quite few good articles around such as this one Investigating Transactions Using Dynamic Management Objects
Cool
Johnson Welch
Johnson Welch
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4533 Visits: 1166
Wison (8/22/2014)
Hi all,
I found the tempdb log file size of one instance increased to 200 GB.
how can i get the root cause of the issue?

any answer is appreciated.

thanks.


You can reduce the tempdb size by using T-SQL, DBCC shrinkDataBase and DBCC shrinkFile. For more information about these visit : http://support.microsoft.com/kb/307487
Wison
Wison
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 151
jacksonandrew321 (8/23/2014)
Wison (8/22/2014)
Hi all,
I found the tempdb log file size of one instance increased to 200 GB.
how can i get the root cause of the issue?

any answer is appreciated.

thanks.


You can reduce the tempdb size by using T-SQL, DBCC shrinkDataBase and DBCC shrinkFile. For more information about these visit : http://support.microsoft.com/kb/307487


actually now the status of tempdb vlf is 2. and i cannot shrink it until the oldest active transaction releases.
so, i only want to get some ideas about how to find the root cause of tempdb log file increased to so large.
er.mayankshukla
er.mayankshukla
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1045 Visits: 487
I would not suggest you to use DBCC ShrinkDatabase, but should see the query which is creating this.
In one of my projects I observed such a behaviour when I was using a bulk delete which caused log file to increase tremendously.

Try to use fn_dblog and try to find which transaction created maximum log
praveenkshanmugam
praveenkshanmugam
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 112
In your case, the reason mite be some long running queries still waiting to commit or mite be blocking. So, as u mentioned in the earlier post that still active transactions are present in ur VLF rite, try to check what operations the Open Transactions are firing. Hope this helps. if u still Unable to find the issue, i can give u more suggestions as i faced similar issues in the past.
Eirikur Eiriksson
Eirikur Eiriksson
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39625 Visits: 19440
er.mayankshukla (8/23/2014)
I would not suggest you to use DBCC ShrinkDatabase, but should see the query which is creating this.
In one of my projects I observed such a behaviour when I was using a bulk delete which caused log file to increase tremendously.

Try to use fn_dblog and try to find which transaction created maximum log


Quick question, have you looked into the sys.dm_tran* views to identify the transaction activities?
Cool
er.mayankshukla
er.mayankshukla
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1045 Visits: 487
Yes, but dmv's like dm_tran_active_transactions Or dm_tran_database_transactions
do not provided me the log length which I require to see which transaction is making my log size to increase.
Wison
Wison
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 151
er.mayankshukla (8/23/2014)
Yes, but dmv's like dm_tran_active_transactions Or dm_tran_database_transactions
do not provided me the log length which I require to see which transaction is making my log size to increase.




I have found some scripts from the internet, but need to combine them using some methods.
that is what i am trying to resolve.
Eirikur Eiriksson
Eirikur Eiriksson
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39625 Visits: 19440
Here is a useful script from Paul S. Randal, lists open transactions with plans and text
Cool
SELECT
[s_tst].[session_id],
[s_es].[login_name] AS [Login Name],
DB_NAME (s_tdt.database_id) AS [Database],
[s_tdt].[database_transaction_begin_time] AS [Begin Time],
[s_tdt].[database_transaction_log_bytes_used] AS [Log Bytes],
[s_tdt].[database_transaction_log_bytes_reserved] AS [Log Rsvd],
[s_est].text AS [Last T-SQL Text],
[s_eqp].[query_plan] AS [Last Plan]
FROM
sys.dm_tran_database_transactions [s_tdt]
JOIN
sys.dm_tran_session_transactions [s_tst]
ON
[s_tst].[transaction_id] = [s_tdt].[transaction_id]
JOIN
sys.[dm_exec_sessions] [s_es]
ON
[s_es].[session_id] = [s_tst].[session_id]
JOIN
sys.dm_exec_connections [s_ec]
ON
[s_ec].[session_id] = [s_tst].[session_id]
LEFT OUTER JOIN
sys.dm_exec_requests [s_er]
ON
[s_er].[session_id] = [s_tst].[session_id]
CROSS APPLY
sys.dm_exec_sql_text ([s_ec].[most_recent_sql_handle]) AS [s_est]
OUTER APPLY
sys.dm_exec_query_plan ([s_er].[plan_handle]) AS [s_eqp]
ORDER BY
[Begin Time] ASC;
GO


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