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


Troubleshooting ReportServerTempDB growth


Troubleshooting ReportServerTempDB growth

Author
Message
dan-572483
dan-572483
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1337 Visits: 1999
We're having periodic issues with the ReportServerTempDB gradually growing until it threatens to fill the drive. It does not respond to a simple DBCC SHRINKFILE command.

Running

select * from sys.databases where name = 'ReportServerTempDB'

Shows the log_reuse_wait and desc to be 4, ACTIVE_TRANSACTION. A BOL article, "Managing the Transaction Log" describes this as:

A transaction is active (all recovery models).

A long-running transaction might exist at the start of the log backup. In this case, freeing the space might require another log backup. For more information, see "Long-Running Active Transactions," later in this topic.


A transaction is deferred (SQL Server 2005 Enterprise Edition and later versions only). A deferred transaction is effectively an active transaction whose rollback is blocked because of some unavailable resource. For information about the causes of deferred transactions and how to move them out of the deferred state, see Deferred Transactions.


We have the recovery model set to Simple, so there are no log backups. Also, the log file is steadily growing over several full backup jobs, so it must be a Deferred Transaction. The solution suggested by BOL works - we turn off all reporting the application, turn off SQL Reporting Services, take the ReportServer & ReportServerTempDB off & online, then the DBCC SHRINKFILE command works.

But I would like to discover the cause of the deferred transaction and prevent this from happening in the first place. Is there a way to query the DB and identify source of the deferred transaction, the report it originates in, or information about the I/O error BOL suggests might cause the deferred transaction?
dan-572483
dan-572483
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1337 Visits: 1999
Folks, I did some reading and dug a little deeper, but I need the advice of a SQL/SSRS guru before moving further. I ran DBCC OPENTRAN on ReportServerTempDB and it returned the following result:

Transaction information for database 'ReportServerTempDB'.

Oldest active transaction:
SPID (server process ID): 442
UID (user ID) : -1
Name : user_transaction
LSN : (187684:21188:1)
Start time : Jun 15 2012 10:07:40:247AM
SID : 0x010500000000000515000000ab52da624617c977ed642f41f74e0000
DBCC execution completed. If DBCC printed error messages, contact your system administrator.


June 15 is indeed the date the ReportServerTempDB started steadily growing. I looked up SPID 442 and it is a Stored Procedure on ReportServer DB called WriteLockSession which updates the ReportServerTempDB.SessionLock table. A select statement from this SP appears in the Activity Monitor Recent Expensive Queries section.

It's tough to know what to do next because this is a production system. I can't experiment with this on nonProduction becuase the issue doesn't happen in nonProduction.

Questions:

1) What might be the consequence of simpley killing SPID 442? How would that affect SSRS functions?

2) I resolved the same issue a few weeks ago by shutting off SSRS, taking the SSRS DBs offline & online, and then DBCC shrinkfile worked successfully. Is there another way to close the active transaction and shrink the log file that doesn't involve an SSRS downtime?

3) Is there a way to prevent this from happening in the future?

Thanks!
RobNicholson 27470
RobNicholson 27470
SSC-Enthusiastic
SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)SSC-Enthusiastic (110 reputation)

Group: General Forum Members
Points: 110 Visits: 229
I also experienced this issue just now. The database and reporting services instances are on 10.50.2500. I killed the transactions as per DBCC OPENTRAN (I didn't want to take the whole instance down). Reporting Services didn't stop after and users were able to run reports. I'm not saying this will work for everyone but it worked for me. In hindsight I should have used fn_dblog to track down what was actually filling the log.
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