当前位置: 代码迷 >> SQL >> SQL SERVER 2008 升级到 SP2后,起动不了
  详细解决方案

SQL SERVER 2008 升级到 SP2后,起动不了

热度:370   发布时间:2016-05-05 12:20:54.0
SQL SERVER 2008 升级到 SP2后,启动不了

微软处理:http://support.microsoft.com/kb/2163980/en-us


当把 SQL Server升级到 SQL Server 2008 sp2之后,可能会造成 SQL Server启动失败。

查看windows的事件记录。可以找到一个错误:Script level upgrade for database 'master' failed because upgrade step 'sqlagent100_msdb_upgrade.sql' encountered error 15281, state 1, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.

解决方法为:

  1. Enable trace flag 902 on the instance of SQL Server 2008 R2. To do this, follow these steps:
    1. Open SQL Server Configuration Manager.
    2. In SQL Server Configuration Manager, clickSQL Server Services.
    3. Double-click the SQL Serverservice.
    4. In the SQL Server Propertiesdialog box, click the Advanced tab.
    5. On click the Advancedtab, locate the Startup Parameters item.
    6. Add ;-T902 to the end of the existing string value, and then clickOK.
  2. Right-click the SQL Serverservice, and then click Start.
  3. If the SQL Server Agent service is running, right-click the SQL Server Agent service, and then clickStop.
  4. Open SQL Server Management Studio, and then connect to the instance of SQL Server 2008 R2.
  5. Run the following statements:
    EXEC sp_configure 'show advanced', 1;
    RECONFIGURE;
    EXEC sp_configure 'allow updates', 0;
    RECONFIGURE;
    EXEC sp_configure 'Agent XPs', 1;
    RECONFIGURE;
    GO
  6. In SQL Server Configuration Manager, right-click the SQL Serverservice, and then clickStop.
  7. Remove trace flag 902 on the instance of SQL Server 2008 R2. To do this, delete;-T902 from the string value that you updated in step 1f.
  8. Right-click the SQL Serverservice, and then click Start.
  9. Right-click the SQL Server Agent service, and then click Start.
  10. In SQL Server Management Studio, reconnect to the instance of SQL Server 2008 R2.
  11. In Object Explorer, expand Management, right-clickData Collection, and then click Enable Data Collection.
    Note If data collection is already enabled, the Enable Data Collection item is unavailable.

注:

有可能按上面的方法处理后,还是不行。从事件里可以看到一个错误信息:

Could not allocate space for object 'dbo.#bulkpackage' in database 'tempdb'

这是由于 tempdb太小造成执行语句失败。

先用;-T902重启 SQL Server之后,把 tempdb文件改大。再删除 ;-T902。重启 SQL Server就行了。









  相关解决方案