3

更新:对不起!由于旧的描述,我可能误导了你。迁移后问题不存在,迁移后 1 周开始出现

我们最近将我们的数据库和报表服务器迁移到一个新的数据库服务器和一个新的报表服务器。

之前的配置:

  • 数据库服务器:2008 Enterprise,DB01/NamedInstance
  • 报表服务器:与数据库服务器相同的服务器,本机模式,数据库凭据为 NT AUTHORITY\NETWORK SERVICE

现在的配置:

  • 数据库服务器:2012 Enterprise,DC01(默认实例,未命名实例)
  • Reporting Services:移至 RP01(本机模式),数据库凭据为 SQL Account(sa)

迁移遵循 MSDN 迁移说明并最终工作(尽管我们必须手动删除冗余的横向扩展部署服务器(与旧服务器同名)以使其工作,我认为这是 SSRS 错误)。

迁移 1 周后,报表开始在新报表服务器上运行极其缓慢。

于是我做了以下分析:

  1. 在旧报表服务器(报表的数据库连接指向新数据库服务器)和新报表服务器中执行报表,旧报表服务器运行速度和以前一样快(1秒),但新报表服务器运行速度极慢(31第二)。

  2. 直接执行报表调用的存储过程,和以前一样快(50毫秒)。

  3. 诊断 [ReportServer$Instance].[dbo].[ExecutionLog] 数据库,TimeDataRetrival 在旧服务器中为 50 毫秒,但在新服务器中为 30050 毫秒。

  4. 运行 SQL Server Profiler,在旧服务器上执行报告,一切正常。在新服务器上执行报告,引起了我的注意。在每批的最后一个事件之后,它会“挂起”(运行)很长时间,然后才会生成“审计注销”。下面的示例实际运行了 10 秒,但所有语句实际上运行了不到 1 秒。

  5. 我怀疑:a)。某些配置(例如帐户访问权限)已在未经我确认的情况下更改。乙)。新的报表服务器正在尝试对没有适当访问权限的用户进行身份验证,并在替代解决方案之前“挂起”几秒钟。

探查器输出的开始:


审核登录——网络协议:TCP/IP 设置quoted_identifier on set arithabort off set numeric_roundabort off set ansi_warnings on set ansi_padding on set ansi_nulls on set concat_null_yields_null on set cursor_close_on_commit off set implicit_transactions off set language us_english set dateformat mdy set datefirst 7 set transaction isolation level读已提交

报告服务器 sa 1440 100 2013-04-16 16:10:14.393 0X2000002838F4010000000000


SQL:BatchStarting
声明 @BatchID 唯一标识符

                                        set @BatchID = NEWID()

                                        UPDATE [Event] WITH (TABLOCKX)
                                            SET [BatchID] = @BatchID,
                                            [ProcessStart] = GETUTCDATE(),
                                            [ProcessHeartbeat] = GETUTCDATE()
                                        FROM (
                                            SELECT TOP 8 [EventID] FROM [Event] WITH (TABLOCKX) WHERE [ProcessStart] is NULL ORDER BY [TimeEntered]
                                            ) AS t1
                                        WHERE [Event].[EventID] = t1.[EventID]

                                        select top 8
                                            E.[EventID],
                                            E.[EventType],
                                            E.[EventData]
                                        from
                                            [Event] E WITH (TABLOCKX)
                                        where
                                            [BatchID] = @BatchID
                                        ORDER BY [TimeEntered]

报告服务器 sa 1440 100 2013-04-16 16:10:14.393


SQL:BatchCompleted
声明 @BatchID 唯一标识符

                                        set @BatchID = NEWID()

                                        UPDATE [Event] WITH (TABLOCKX)
                                            SET [BatchID] = @BatchID,
                                            [ProcessStart] = GETUTCDATE(),
                                            [ProcessHeartbeat] = GETUTCDATE()
                                        FROM (
                                            SELECT TOP 8 [EventID] FROM [Event] WITH (TABLOCKX) WHERE [ProcessStart] is NULL ORDER BY [TimeEntered]
                                            ) AS t1
                                        WHERE [Event].[EventID] = t1.[EventID]

                                        select top 8
                                            E.[EventID],
                                            E.[EventType],
                                            E.[EventData]
                                        from
                                            [Event] E WITH (TABLOCKX)
                                        where
                                            [BatchID] = @BatchID
                                        ORDER BY [TimeEntered]
                                            Report Server       sa  0   7   0   0   1440    100 2013-04-16 16:10:14.393 2013-04-16 16:10:14.393     

SQL:BatchStarting
声明 @BatchID 唯一标识符

                                set @BatchID = newid()

                                UPDATE [Notifications] WITH (TABLOCKX)
                                    SET [BatchID] = @BatchID,
                                    [ProcessStart] = GETUTCDATE(),
                                    [ProcessHeartbeat] = GETUTCDATE()
                                FROM (
                                    SELECT TOP 8  [NotificationID] FROM [Notifications] WITH (TABLOCKX) WHERE ProcessStart is NULL and
                                    (ProcessAfter is NULL or ProcessAfter < GETUTCDATE()) ORDER BY [NotificationEntered]
                                ) AS t1
                                WHERE [Notifications].[NotificationID] = t1.[NotificationID]

                                select top 8
                                        -- Notification data
                                        N.[NotificationID],
                                        N.[SubscriptionID],
                                        N.[ActivationID],
                                        N.[ReportID],
                                        N.[SnapShotDate],
                                        N.[DeliveryExtension],
                                        N.[ExtensionSettings],
                                        N.[Locale],
                                        N.[Parameters],
                                        N.[SubscriptionLastRunTime],
                                        N.[ProcessStart],
                                        N.[NotificationEntered],
                                        N.[Attempt],
                                        N.[IsDataDriven],
                                        SUSER_SNAME(Owner.[Sid]),
                                        Owner.[UserName],
                                        -- Report Data
                                        O.[Path],
                                        N.[ReportZone],
                                        O.[Type],
                                        SD.NtSecDescPrimary,
                                        N.[Version],
                                        Owner.[AuthType]
                                    from 
                                        [Notifications] N with (TABLOCKX) inner join [Catalog] O on O.[ItemID] = N.[ReportID]
                                        inner join [Users] Owner on N.SubscriptionOwnerID = Owner.UserID
                                        left outer join [SecData] SD on O.[PolicyID] = SD.[PolicyID] AND SD.AuthType = Owner.AuthType
                                    where 
                                        N.[BatchID] = @BatchID
                                ORDER BY [NotificationEntered]

报告服务器 sa 1440 100 2013-04-16 16:10:14.393


SQL:BatchCompleted
声明 @BatchID 唯一标识符

                                set @BatchID = newid()

                                UPDATE [Notifications] WITH (TABLOCKX)
                                    SET [BatchID] = @BatchID,
                                    [ProcessStart] = GETUTCDATE(),
                                    [ProcessHeartbeat] = GETUTCDATE()
                                FROM (
                                    SELECT TOP 8  [NotificationID] FROM [Notifications] WITH (TABLOCKX) WHERE ProcessStart is NULL and
                                    (ProcessAfter is NULL or ProcessAfter < GETUTCDATE()) ORDER BY [NotificationEntered]
                                ) AS t1
                                WHERE [Notifications].[NotificationID] = t1.[NotificationID]

                                select top 8
                                        -- Notification data
                                        N.[NotificationID],
                                        N.[SubscriptionID],
                                        N.[ActivationID],
                                        N.[ReportID],
                                        N.[SnapShotDate],
                                        N.[DeliveryExtension],
                                        N.[ExtensionSettings],
                                        N.[Locale],
                                        N.[Parameters],
                                        N.[SubscriptionLastRunTime],
                                        N.[ProcessStart],
                                        N.[NotificationEntered],
                                        N.[Attempt],
                                        N.[IsDataDriven],
                                        SUSER_SNAME(Owner.[Sid]),
                                        Owner.[UserName],
                                        -- Report Data
                                        O.[Path],
                                        N.[ReportZone],
                                        O.[Type],
                                        SD.NtSecDescPrimary,
                                        N.[Version],
                                        Owner.[AuthType]
                                    from 
                                        [Notifications] N with (TABLOCKX) inner join [Catalog] O on O.[ItemID] = N.[ReportID]
                                        inner join [Users] Owner on N.SubscriptionOwnerID = Owner.UserID
                                        left outer join [SecData] SD on O.[PolicyID] = SD.[PolicyID] AND SD.AuthType = Owner.AuthType
                                    where 
                                        N.[BatchID] = @BatchID
                                ORDER BY [NotificationEntered]

报表服务器 sa 0 7 0 0 1440 100 2013-04-16 16:10:14.393 2013-04-16 16:10:14.393


审核注销
报告服务器 sa 0 3836 6 10140 1440 100 2013-04-16 16:10:14.393 2013-04-16 16:10:24.533

4

2 回答 2

1

好的,我想我想出了如何解决它。我修改了报告文件(.rdl)并上传到新的报告服务器以覆盖现有的,它运行速度如预期的那样快。

我怀疑是因为我们使用数据库备份/恢复将 SSRS 2008 迁移到 SSRS 2012,而 SSRS 2012 没有自动升级文件格式,这导致了问题。

于 2013-04-18T04:49:31.710 回答
1

您是否从方程式中消除了参数嗅探?

快速查询在 SSRS 中运行缓慢

尝试将匹配的假参数添加到存储过程中,然后在开始时为它们提供相应参数传入的值。看看报告是否以这种方式运行得更快。

于 2013-04-17T00:19:01.610 回答