1.项目背景

由于历史原因,公司部分系统的Report是基于SQL Server Report Service搭建的,且Reporting Services 和Report Server DataBase是部署在不同的DB上的。因报表数据库所在机器过保,需要将Report Server数据库和ReportServerTempDB数据库迁移至新的Server上。但因项目老旧,研发和运维人员更迭,相关文档不完善,所以,这次迁移过程中,我们还是遇到了一个不小的坑。

迁移要求,如下图所示:

但是很不幸,迁移后,report service 报错。

2.报错信息

 service 错误信息如下:

  1. 报表服务器数据库的版本格式无效,或无法读取。已找到的版本为“147”,而所需的版本为“C.0.8.54”。若要继续操作,请更新报表服务器数据库的版本并验证其访问权限。 (rsInvalidReportServerDatabase) (rsRPCError) 获取联机帮助

查看report 服务的log,文件 ReportServerService__12_04_2018_18_56_15.log.txt,

完整的信息如下

  1. <Header>
  2. <Product>Microsoft SQL Server Reporting Services 版本 9.00.5000.00</Product>
  3. <Locale>zh-CN</Locale>
  4. <TimeZone>中国标准时间</TimeZone>
  5. <Path>Z:\Program Files\Microsoft SQL Server\MSSQL.1\Reporting Services\LogFiles\ReportServerService__12_4_2021_18_56_15.log</Path>
  6. <SystemName>weixinqqyijiaqin113</SystemName>
  7. <OSName>Microsoft Windows NT 6.1.7601 Service Pack 1</OSName>
  8. <OSVersion>6.1.7601.65536</OSVersion>
  9. </Header>
  10. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing ConnectionType to '0' as specified in Configuration file.
  11. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing IsSchedulingService to 'True' as specified in Configuration file.
  12. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing IsNotificationService to 'True' as specified in Configuration file.
  13. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing IsEventService to 'True' as specified in Configuration file.
  14. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing PollingInterval to '10' second(s) as specified in Configuration file.
  15. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing WindowsServiceUseFileShareStorage to 'False' as specified in Configuration file.
  16. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing MemoryLimit to '60' percent as specified in Configuration file.
  17. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing RecycleTime to '720' minute(s) as specified in Configuration file.
  18. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing MaximumMemoryLimit to '80' percent as specified in Configuration file.
  19. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing MaxAppDomainUnloadTime to '30' minute(s) as specified in Configuration file.
  20. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing MaxQueueThreads to '0' thread(s) as specified in Configuration file.
  21. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing IsWebServiceEnabled to 'True' as specified in Configuration file.
  22. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing MaxActiveReqForOneUser to '300' requests(s) as specified in Configuration file.
  23. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing MaxScheduleWait to '5' second(s) as specified in Configuration file.
  24. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing DatabaseQueryTimeout to '120' second(s) as specified in Configuration file.
  25. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing ProcessRecycleOptions to '0' as specified in Configuration file.
  26. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing RunningRequestsScavengerCycle to '60' second(s) as specified in Configuration file.
  27. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing RunningRequestsDbCycle to '60' second(s) as specified in Configuration file.
  28. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing RunningRequestsAge to '30' second(s) as specified in Configuration file.
  29. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing CleanupCycleMinutes to '10' minute(s) as specified in Configuration file.
  30. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing DailyCleanupMinuteOfDay to default value of '120' minutes since midnight because it was not specified in Configuration file.
  31. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing WatsonFlags to '1064' as specified in Configuration file.
  32. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing WatsonDumpOnExceptions to 'Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException,Microsoft.ReportingServices.Modeling.InternalModelingException' as specified in Configuration file.
  33. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing WatsonDumpExcludeIfContainsExceptions to 'System.Data.SqlClient.SqlException,System.Threading.ThreadAbortException' as specified in Configuration file.
  34. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing SecureConnectionLevel to '0' as specified in Configuration file.
  35. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing DisplayErrorLink to 'True' as specified in Configuration file.
  36. ReportingServicesService!library!4!2018/12/4-18:56:15:: i INFO: Initializing WebServiceUseFileShareStorage to 'False' as specified in Configuration file.
  37. ReportingServicesService!resourceutilities!4!2018/12/4-18:56:16:: i INFO: Reporting Services starting SKU: Enterprise
  38. ReportingServicesService!resourceutilities!4!2018/12/4-18:56:16:: i INFO: Evaluation copy: 0 days left
  39. ReportingServicesService!library!9!2018/12/4-18:56:16:: i INFO: Catalog SQL Server Edition = Enterprise
  40. ReportingServicesService!library!9!2018/12/4-18:56:16:: i INFO: Current DB Version 147, Instance Version C.0.8.54.
  41. ReportingServicesService!library!9!2018/12/4-18:56:16:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportServerDatabaseException: 报表服务器数据库的版本格式无效,或无法读取。已找到的版本为“147”,而所需的版本为“C.0.8.54”。若要继续操作,请更新报表服务器数据库的版本并验证其访问权限。, ;
  42. Info: Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportServerDatabaseException: 报表服务器数据库的版本格式无效,或无法读取。已找到的版本为“147”,而所需的版本为“C.0.8.54”。若要继续操作,请更新报表服务器数据库的版本并验证其访问权限。
  43. ReportingServicesService!library!9!2018/12/4-18:56:16:: e ERROR: Exception caught while starting service. Error: Microsoft.ReportingServices.Diagnostics.Utilities.InvalidReportServerDatabaseException: 报表服务器数据库的版本格式无效,或无法读取。已找到的版本为“147”,而所需的版本为“C.0.8.54”。若要继续操作,请更新报表服务器数据库的版本并验证其访问权限。
  44. 在 Microsoft.ReportingServices.Library.ConnectionManager.EnsureCorrectDBVersion()
  45. 在 Microsoft.ReportingServices.Library.ConnectionManager.ConnectStorage()
  46. 在 Microsoft.ReportingServices.Library.ServiceController.ServiceStartThread()
  47. ReportingServicesService!library!9!2018/12/4-18:56:16:: e ERROR: Attempting to start service again...

3.错误分析

3.1 简单分析尝试

查看迁移前后两台机器的SQL实例,其版本一致,确实一致,如下:

  1. Microsoft SQL Server 2008 R2 (SP3) - 10.50.6000.34 (X64)

按照提示及大众意见,点击升级数据库也不行

提示数据库的版本验证不通过。

3.2 从版本入手,重点分析版本

错误提示版本不对,那我们找下Report server 和 Report server database的版本信息。下表列出了截至目前(2015/04/29)发布的报表服务器和报表服务器数据库的版本号:

Release

Report server

Report server database

SQL Server 2008 R2

10.50.nnnn.nn

n/a

SQL Server 2008 Service Pack 1 (SP1)

10.0.2531.00

C.0.9.45

SQL Server 2008

10.0.1600.00

C.0.9.45

SQL Server 2005 Reporting Services Service Pack 3 (SP3)

9.0.4035.00

C.0.8.54

SQL Server 2005 Reporting Services Service Pack 2 (SP2)

9.0.3042.00

C.0.8.54

SQL Server 2005 Express with Advanced Services

9.0.3042.00

C.0.8.45

SQL Server 2005 Reporting Services Service Pack 1 (SP1)

9.0.2049.00

C.0.8.43

SQL Server 2005 Reporting Services

9.0.1399.01

C.0.8.40

SQL Server 2000 Reporting Services Service Pack 2 (SP2)

8.00.1038

C.0.6.54

SQL Server 2000 Reporting Services Service Pack 1 (SP1)

8.00.0878

C.0.6.51

SQL Server 2000 Reporting Services

8.00.0743

C.0.6.43

现在来看,Reporting Services Service 应该安装的是2005 SP2 (或者 SP3),但是 Report server database 安装的是2008 R2 SP3。

到此,也应该知道为什么升级版本不对了,当Reporting Services Service 版本 高于 Report server database 版本(的要求)时,可以考虑通过升级解决保存版本不适配问题。我们现在遇到的情况正好相反,Report server database 版本高于Reporting Services Service 版本(的要求)了。

4 方案探究

4.1 问题解决

其实问题清晰了,就是Report server 和 Report server database的版本不适配导致的

再回到迁移项目本身来看,迁移前后,SQL Server 实例的版本一致(Microsoft SQL Server 2008 R2 (SP3)),迁移前运行OK,迁移后就完犊子了,这说明Report server database的版本还受制于其它因素。

是什么限制的呢?众里寻他千百度,一次又一次,尝试N中方法....

忽然发现,原Report server database所在的Server 没有安装 Reporting Services,而新的Report server database所在的Server 在安装 SQL Server实例时,选择功能时,选择的时是【Select All】,即 新的Server 有安装Reporting Services。这一发现 是通过C:\Program Files\Microsoft SQL Server 路径下的安装文件发现的。

补充一点,新 Server的SQL Server实例安装后,本身有Report Server数据库和ReportServerTempDB数据库,为了迁移,我们是先将DB drop 掉,然后再附加(attach)原DB Server的DB文件。

4.2 方案验证

新安装一个SQL Server实例,但是不安装Reporting Services,即到功能选择时,按照图中标识的选择。

安装后,附加(attach)原DB Server的DB文件(Report Serve和ReportServerTempDB的DB文件),然后配置Reporting Services (主要是配置报表服务器数据库连接),这时OK了,服务正常了。

OK!

OK!

OK!

这也说明,思考的方向是正确的。

4.3 结论或推断

(1)Report server database的版本 与 所在SQL Server 实例的版本不同;

(2)安装SQL Server 实例时,如未安装Reporting Services,则 Report server database(Report Server和ReportServerTempDB)附加到不同版本SQL Server 实例上时,Report server database的版本 不变;

(3)安装SQL Server 实例时,如有安装Reporting Services,则 远程电脑上的Reporting Services 连接 本机的Report server database时,获取的Report server database的版本版本是安装时的版本。虽可 删除、再附加 不同 版本的Report server database,但获取的版本仍是安装时的版本。即,此时符合 (2)的推论 不同。

(4)造成(3)的原因,推测为: 安装SQL Server 实例时安装Reporting Services,有将安装时的Report server database的版本保存到注册表或系统表,远程电脑上的Reporting Services 连接 本机的Report server database时,优先从注册表或系统表 获取信息(,不再读取附加的Report server database的版本)。

5.参考文档

1.升级报表服务器数据库

https://docs.microsoft.com/zh-cn/previous-versions/sql/sql-server-2005/ms403392(v=sql.90)

2.rsInvalidReportServerDatabase

https://docs.microsoft.com/zh-cn/previous-versions/sql/sql-server-2005/bb326494(v=sql.90)?redirectedfrom=MSDN

3.如何检测版本信息 (Reporting Services)---2008

https://docs.microsoft.com/zh-cn/previous-versions/sql/sql-server-2008/bb630446(v=sql.100)

4.如何检测版本信息 (Reporting Services) ---2008R

https://docs.microsoft.com/zh-cn/previous-versions/sql/sql-server-2008-r2/bb630446(v=sql.105)

迁移Report Server DataBase时遇到的坑的更多相关文章

  1. SQL Server 2012 The report server cannot open a connection to the report server database

    案例环境: 操作系统版本:    Windows Server 2012 R2 Standard 数据库版本  :    SQL SERVER 2012 SP2 案例介绍: 今天进入一台新安装的SQL ...

  2. Step by step Install a Local Report Server and Remote Report Server Database

    原创地址:http://www.cnblogs.com/jfzhu/p/4012097.html 转载请注明出处 前面的文章<Step by step SQL Server 2012的安装 &g ...

  3. [转]How to: Create a Report Server Database (Reporting Services Configuration)

    本文转自:https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms157300%28v%3dsql.10 ...

  4. Web service request SetParameters to Report Server http://host/reportserver failed. Error: 请求因 HTTP 状态 401 失败: Unauthorized

    迁移CRM服务器完成后在访问CRM的内部报表时报错,在查看应用服务器的日志时发现报"Web service request SetParameters to Report Server ht ...

  5. P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1

    P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1       May ...

  6. 解决将Excel表导入到SQL Server数据库时出现Text was truncated or one or more characters had no match in the target code错误

    编写python爬虫程序可以在电商.旅游等网站上爬取相关评论数据,这些数据可以用于词云制作.感情词分析.提取关键词等,也可以将爬取下来的数据以自己的方式进行展示.评论数据爬取下来后,就要考虑怎样入库, ...

  7. 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连

    在建立与服务器的连接时出错.在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连 sql server服务器sqlserver远程连接数据库防火墙在建立 ...

  8. Report Server multiple value 多值选择

    一.项目需求 今天在做项目的时候,有一个需求,具体如下:在Report Server中存在一个报表,报表中有一个参数doctor_name,该参数允许多值,默认全部.但是由于前端页面医生选择时多选没有 ...

  9. 使用redis-py的两个类Redis和StrictRedis时遇到的坑

    使用redis-py的两个类Redis和StrictRedis时遇到的坑 前言: 今天产品经理说,有几个队列排序的功能不能用了.对比了下以前的代码查到了一个原因,这个比较的坑,总结起来也是自己没好好看 ...

随机推荐

  1. Jenkins 基础篇 - 小试牛刀

    现在我们来创建一个简单的 Jenkins 任务,这个任务输出 Java 版本信息和系统信息,通过这个任务我们先了解创建 Jenkins 任务的流程,以及了解一些对任务的基础设置,接下来就是演示任务的整 ...

  2. Vue | 指令实现自动翻译填充英文名功能

    背景:应用系统中存在多个创建实体表单,表单填写时,在填写中文名称后,要填写对应的英文名作为标识或数据库查询索引. 需求:填写中文名的同时,系统自动生成英文名并填充到表单中,辅助用户操作,节约操作时间. ...

  3. [Python] 基本概念

    1.基本概念 三大特性:封装.继承.多态 继承:派生类继承基类的字段和方法 多态:对不同类型的变量进行相同的操作,却表现出不同的行为(例如对数字和字符做"+"运算) 封装:将数据和 ...

  4. [DB] Redis

    为什么用Redis 是什么 一个小程序 缓存 & 数据库 单线程worker 新版本:IO threads epoll:多路复用 与Memcache区别 支持持久化:RDB快照.AOF日志 丰 ...

  5. groovy脚本语言基础1

    一 搭建groovy环境 安装JDK [root@node1 ~]# yum  -y install java-11-openjdk 官网下载groovySDK下载 https://groovy.ap ...

  6. Maven知识点一览

    Maven 介绍和搭建 介绍 Maven是基于项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告,和文档的软件项目管理工具. 环境搭建 网址:https://maven.apache ...

  7. VS 中的 lib 和 dll 的区别和使用

    在 vs/c# 项目开发中,经常会遇到 lib 和 dll 文件,而且创建工程项目以及工程项目打包时也是必须要面对的,所以有必要掌握 lib 和 dll 的区别和使用. 静态库:在链接步骤中,连接器将 ...

  8. git push 时发生错误 error: src refspec master does not match any. error: failed to push some refs to

    很多相关解决办法都是最后要 push 到远端的 master 上,但很多其实要求不能把个人的修改内容直接 push 到 master 主分支. 因此,当我想将本地 feature/work1 分支的修 ...

  9. Centos下删除文件后空间并未释放

    [root@DeviceSP /]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vda3 90G 82G 3.8G 96% / tmp ...

  10. 编写程序,计算当n=10000,20000,30000...100000时,π的值.求π的近似公式 π=4*(1-1/3+1/5-1/7+1/9-1/11+1/13-...+1/(2n-1)-1/(2n+1))

    该程序是求的 π 近似值,所以随着 i 的增大,值会无线接近于 3.1415926... 代码示例 : package judgment;/** * 编写程序,计算当n=10000,20000,300 ...