我拥有的报表服务器数据库超过 300GB(注意 - 它是 ReportServer 而不是 ReportServerTempDB)。dbo.segment 表有超过 3500 万条记录。我不太清楚为什么它长得这么大。起初,我查看了快照并将站点设置下的限制设置为 10 天,而不是无限制。不幸的是,这并没有解决问题。请问有人可以给我任何关于下一步看哪里的建议吗?请注意,另一台服务器上的数据库大约为 5GB,我希望它在哪里。
1 回答
Anything in the ReportServerTempDB
database is fair game for deletion, so long as you can stop and restart the Report Server service while doing so.
Report Server temporary database
Each report server database uses a related temporary database to store session and execution data, cached reports, and work tables that are generated by the report server. Background server processes will periodically remove older and unused items from the tables in the temporary database.
Reporting Services does not re-create the temporary database if it is missing, nor does it repair missing or modified tables. Although the temporary database does not contain persistent data, you should back up a copy of the database anyway so that you can avoid having to re-create it as part of a failure recovery operation.
If you back up the temporary database and subsequently restore it, you should delete the contents. Generally, it is safe to delete the contents of the temporary database at any time. However, you must restart the Report Server Windows service after you delete the contents.
You should definitely back it up before doing that, though... you never know what bugs lay in waiting.
The most likely source of database growth in the ReportServer
database is Report History Snapshots. You can configure this via the SSRS management web interface in Site Settings > General:
- Select the default settings for report history:
- Keep an unlimited number of snapshots in report history
- Limit the copies of report history [number] (in days)
Or, alternatively, via SSMS via the SQL Server Reporting Service's Server Properties > History panel:
- Keep an unlimited number of snapshots in report history
- Limit the copies of report history: [number] (in days)