大网数据广告活动
数据库与应用安全

SQL Server upgrade fails with error 15151 when executing Update Database scripts

· 52CE 我爱测

This article describes error 15151 that stops a SQL Server upgrade when update database scripts are run.

This article helps you troubleshoot error 15151 that occurs when you install a cumulative update (CU) or service pack (SP) for Microsoft SQL Server. The error occurs when database upgrade scripts are run.

Symptoms

When you apply a CU or SP, the Setup program returns the following error message:

Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.

Additionally, the following error entry might be logged in the SQL Server error log:

Error: 15151, Severity: 16, State: 1.
Cannot find the login '##MS_SSISServerCleanupJobLogin##', because it does not exist or you do not have permission.

Cause

This issue occurs because either the login (server principal) was dropped manually or these instructions aren't followed.

For more information about database upgrade scripts that run during the CU or SP installation, see Troubleshoot upgrade script failures when applying an update.

Resolution

To resolve the issue, follow these steps:

  1. Start SQL Server with trace flag 902.

  2. Re-create the login on the server:

    CREATE LOGIN [##MS_SSISServerCleanupJobLogin##]
    WITH PASSWORD = N'<password>',
    DEFAULT_DATABASE = [master],
    DEFAULT_LANGUAGE = [us_english],
    CHECK_EXPIRATION = OFF,
    CHECK_POLICY = OFF;
    
  3. Switch to the SSISDB database, and map the existing user to the newly created login:

    USE SSISDB
    GO
    ALTER USER [##MS_SSISServerCleanupJobUser##] WITH LOGIN =[##MS_SSISServerCleanupJobLogin##]
    
  4. In some cases, the database user information might also be missing. In this case, re-create the user in the SSISDB database, and then rerun the previous step to map the user to the login:

    USE [SSISDB]
    GO
    DROP USER [##MS_SSISServerCleanupJobUser##]
    GO
    
    CREATE USER [##MS_SSISServerCleanupJobUser##] FOR LOGIN [##MS_SSISServerCleanupJobLogin##]
    GO
    
    ALTER USER [##MS_SSISServerCleanupJobUser##] WITH DEFAULT_SCHEMA=[dbo]
    GO
    
    GRANT EXECUTE ON [internal].[cleanup_server_project_version] TO [##MS_SSISServerCleanupJobUser##]
    GO
    GRANT EXECUTE ON [internal].[cleanup_server_retention_window] TO [##MS_SSISServerCleanupJobUser##]
    GO
    

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 04/08/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。