January 21, 2015
I got a 400Gb log file for my birthday today.
This 400gb made me mad, It’s just a temp db. And all processes are down this morning. Looking around on the internet, this seems to be a common known problem, some even state this problem is acknowledged by Microsoft.
After reading some blogs on possible solutions. I decided I need to solve the disk problem first. First checks you need to do before you start the troubleshoot:
You need to rule out that you didn’t bring this over yourself, the ReportTempDb needs to be in Simple mode, this means there are no logbackups and the it should automatically reclaim space in your logfiles, well, this is how it should work. But in this case the logspace keeps growing. Indicating something is wrong with the reportserver, when it already is in Simple mode.
Also It could be worthwhile to check which reports are costing you, since not only your log space is invaded by report servers, your CPU is probably a victim too..
SELECT sd.ReportPath, COUNT(s.SegmentId) as CountOfSegmentId FROM [ReportServerTempDB].dbo.Segment s INNER JOIN [ReportServerTempDB].dbo.ChunkSegmentMapping m ON m.SegmentId = s.SegmentId INNER JOIN [ReportServerTempDB].dbo.SegmentedChunk c ON c.ChunkId = m.ChunkId INNER JOIN [ReportServerTempDB].dbo.SessionData sd ON sd.SnapshotDataID = c.SnapshotDataId GROUP BY sd.ReportPath ORDER BY CountOfSegmentId DESC;
After these checks, we have 2 routes to go, but today we’ll will start with the quick and dirty one, solve the disk shortage, since all processes are put to a stop due to this ‘Stay Puft’ logfile. We need to shrink this beast, I should tell you, shrinking your database is pure evil and risk taking. You should never ever ever do this! …Unless even Microsoft says it’s ok. And it’s just tempdata. It should’ve just deleted itself.
First, we are gonna run a full backup of the ReportserverTempDb, to an external location, ofcourse. Once this is done, we canstart with the clean up of the logfile.
Bring your database level to full mode, this allows you to alter the filegroups.
Right click tthe ReportServerTempDb database Go to the option shrink –> files and check the available free space and check the release unused space button.
This should give you some space, in my case, 400Gb, whoohoo, Dobby is free! Don’t forget to put your ReportServertempDb back into simple mode!
You could also shrink the log file with the ‘shrink file’ option, but like I said earlier, it’s better to avoid this option, because it could lead to faulty logfiles when you need to recover. But I case of this ReportServerTempDb the risk is low.
Now that we have got some diskspace back, we need to dig deeper to find out the cause of this log file eating up all your precious disk space. Next topic will be how we can fix this Stay Puft log file growth.