博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
report server tempdb 过大问题
阅读量:4214 次
发布时间:2019-05-26

本文共 3303 字,大约阅读时间需要 11 分钟。

Hi abeljda,

In Reporting Services, the ReportServerTempdb is created with the primary report server database and used to store temporary data, session information, and cached reports. For the Segment table in the ReportServerTempdb, it stores temporary large objects such as cached reports.

In this issue, the Segment table grows significantly may occur due to the following reasons:

  • The report execution takes longer than 10 minutes. (The CleanupCycleMinutes is configured for 10 minutes.)
  • The report snapshots are too large to process for reporting services.
Because of the above issue, as the time progresses it left lots of orphaned snapshots which in turn resulted in growth of the database. Additionally, if a snapshot is deleted from the corresponding report, the snapshotdata and segment table gets cleaned up by reporting services every 12 hours automatically. That's why the "dbcleanup!windowsservice" runs. To work around the issue, we can use the following steps: 1. On the report manager, click "Site Settings", and switch the default settings for report history to "Limit the copies of report history: 10" instead. 2. Run the following script to remove orphans manually based on your requirement: begin transaction        declare @cleanedSnapshots table (SnapshotDataId uniqueidentifier) ;               declare @cleanedChunks table (ChunkId uniqueidentifier) ;        declare @cleanedSegments table (ChunkId uniqueidentifier, SegmentId uniqueidentifier) ;                declare @deleteCount int ;        insert into @cleanedSnapshots       select  distinct SnapshotDataId       from SegmentedChunk        where SnapshotDataId not in (select SnapshotDataID from SnapshotData)        -- clean up chunks       set @deleteCount = 1 ;        while (@deleteCount > 0)       begin                       delete top(20)  SC               output deleted.ChunkId into @cleanedChunks(ChunkId)              from SegmentedChunk SC with (readpast)                 join @cleanedSnapshots cs on SC.SnapshotDataId = cs.SnapshotDataId ;               set @deleteCount = @@ROWCOUNT ;        end ;              -- clean up unused mappings       set @deleteCount = 1 ;            while (@deleteCount > 0)       begin                       delete top(20)  CSM              output deleted.ChunkId, deleted.SegmentId into @cleanedSegments (ChunkId, SegmentId)              from ChunkSegmentMapping CSM with (readpast)              join @cleanedChunks cc ON CSM.ChunkId = cc.ChunkId              where not exists (                     select 1 from SegmentedChunk SC                     where SC.ChunkId = cc.ChunkId )               and not exists (                     select 1 from [ReportServerTempDB].dbo.SegmentedChunk TSC                     where TSC.ChunkId = cc.ChunkId ) ;              set @deleteCount = @@ROWCOUNT ;       end ;              -- clean up segments       set @deleteCount = 1       while (@deleteCount > 0)       begin              delete top(20) S              from Segment S with (readpast)              join @cleanedSegments cs on S.SegmentId = cs.SegmentId              where not exists (                     select 1 from ChunkSegmentMapping csm                     where csm.SegmentId = cs.SegmentId ) ;              set @deleteCount = @@ROWCOUNT ;       end commit Regards,Mike Yin

转载地址:http://zlfmi.baihongyu.com/

你可能感兴趣的文章
中断API之irq_set_chip_data
查看>>
中断API之irq_set_irq_type
查看>>
中断API之setup_irq
查看>>
查看模块参数
查看>>
udev重命名网口
查看>>
pgrep
查看>>
test-definitions/blob/master/toolset/util/parallel_cmds.py
查看>>
中断API之irq_activate
查看>>
中断API之tasklet_disable_nosync/tasklet_trylock/tasklet_unlock
查看>>
中断API之tasklet_init/tasklet_kill
查看>>
内存管理API之__free_pages
查看>>
内存管理API之__get_free_pages
查看>>
内存管理API之__get_vm_area
查看>>
内存管理API之krealloc
查看>>
内存管理API之ksize
查看>>
内存管理API之alloc_pages
查看>>
linux performance tool
查看>>
test-definitions/blob/master/auto-test/bazel/bazel.sh
查看>>
test-definitions/blob/master/auto-test/bigdata/bigdata.sh
查看>>
/test-definitions/blob/master/auto-test/blktrace/blktrace.sh
查看>>