Troubleshooting ReportServerTempDB growth

  • 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?

  • 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!

  • 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.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply