SQL Server 2000 Reporting Service服务自动启动失败

这几天在做一个SQL Server 2000的虚拟机环境,其中安装了SQL Server 2000 Reporting Service,每次启动的时候都会遇到服务启动失败的报错,经过确认是Report Server服务无法自动启动。结果发现Report Server和MSSQLServer服务之间没有依赖关系,但事实上Report Server的Catalog是存储在SQL Server的某个实例中的,所以可能是虚拟机处理速度的原因导致MSSQLServer启动过程太长,Report Server在启动的时候无法获取Catalog数据库的访问,因此Report Server自动启动失败。

经过检查Reporting Service的日志确认了这一原因,Reporting Service的日志可以在Reporting Service安装目录的LogFiles目录中找到,下面是报错部分的副本:

ReportingServicesService!library!674!2007-9-14-20:59:58:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerDatabaseUnavailableException: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing., ;
 Info: Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerDatabaseUnavailableException: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. —> System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
   at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
   at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.ReportingServices.Library.ConnectionManager.OpenConnection()
   — End of inner exception stack trace —
ReportingServicesService!library!674!2007-9-14-20:59:58:: Exception caught while starting service. Error: Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerDatabaseUnavailableException: The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. —> System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
   at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
   at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.ReportingServices.Library.ConnectionManager.OpenConnection()
   — End of inner exception stack trace —
   at Microsoft.ReportingServices.Library.ConnectionManager.OpenConnection()
   at Microsoft.ReportingServices.Library.ConnectionManager.ConnectStorage()
   at Microsoft.ReportingServices.Library.ConnectionManager.VerifyConnection()
   at Microsoft.ReportingServices.Library.ServiceController.ServiceStartThread()
ReportingServicesService!library!674!2007-9-14-20:59:58:: Attempting to start service again…

当然微软没有为Report Server服务添加依赖关系也是有原因的,因为Reporting Service的Catalog不一定是在本地的SQL Server实例中,因此Report Server和本地的MSSQLServer服务的依赖性是不确定的,不过我们大多数的部署环境两个服务都是在一台服务器上,因此我们可以手动为Report Server和MSSQLServer服务添加依赖性。具体的步骤如下:

  1. 打开regedt32(不是regedit哦!)
  2. 在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ReportServer键下面添加一个名为DependOnService的值(类型是REG_MULTI_SZ,这就是为什么不用regedit的原因,貌似regedit添加不了这种类型的值),值设置为MSSQLSERVER。
  3. 关闭regedt32程序,打开Service管理控制台,检查Report Server服务,就会注意到Report Server现在依赖于MSSQLServer服务了。
     
  4. 重新启动虚拟机,果然没有再报服务启动失败的错误。

附注:

如果Reporting Service依赖于的MSSQLServer实例不是默认实例,可以在Services管理控制台中双击对应实例的MSSQLServer服务来确定其服务名,如下图:

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: