L'aggiornamento di SQL Server ha esito negativo e restituisce l'errore 15173 o 15559
Questo articolo consente di risolvere l'errore 15173 o 15559 che si verifica quando si installa un aggiornamento cumulativo (CU) o Service Pack (SP) per Microsoft SQL Server. L'errore si verifica quando vengono eseguiti gli script di aggiornamento del database.
Sintomi
Quando si applica un cu o un sp per SQL Server, il programma di installazione segnala l'errore seguente:
Attesa dell'handle di recupero del Motore di database non riuscita. Controllare il log degli errori di SQL Server per individuare le possibili cause.
Quando si controlla il log degli errori di SQL Server, si noterà una delle voci di errore seguenti.
Set di messaggi di errore 1:
Error: 15173, Severity: 16, State: 1.
Server principal '##MS_PolicyEventProcessingLogin##' has granted one or more permission(s). Revoke the permission(s) before dropping the server principal.
Error: 912, Severity: 21, State: 2.
Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 15173, 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.
EventID 3417
Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
Set di messaggi di errore 2:
Dropping existing Agent certificate ...
Error: 15559, Severity: 16, State: 1.
Cannot drop certificate '##MS_AgentSigningCertificate##' because there is a user mapped to it.
Error: 912, Severity: 21, State: 2.
Script level upgrade for database 'master' failed because upgrade step 'sqlagent100_msdb_upgrade.sql' encountered error 15559, 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.
Error: 3417, Severity: 21, State: 3.
Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.</br>
SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
Causa
Questo problema si verifica perché uno script di aggiornamento smette di eseguire perché non può eliminare l'entità server ( ##MS_PolicyEventProcessingLogin##
o ##MS_AgentSigningCertificate##
). Questo errore si verifica perché viene eseguito il mapping di un utente all'entità server.
Per altre informazioni sugli script di aggiornamento del database eseguiti durante l'installazione di CU o SP, vedere Risolvere gli errori di script di aggiornamento durante l'applicazione di un aggiornamento.
Risoluzione
Per risolvere l'errore 15173 o 15559, seguire questa procedura:
Avviare SQL Server insieme al flag di traccia (TF) 902. Per altre informazioni, vedere Passaggi per avviare SQL con il flag di traccia 902.
Connettersi a SQL Server ed eseguire una delle query seguenti, a seconda dell'entità server indicata nel messaggio di errore:
SELECT a.name, b.permission_name FROM sys.server_principals a INNER JOIN sys.server_permissions b ON a.principal_id = b.grantee_principal_id INNER JOIN sys.server_principals c ON b.grantor_principal_id = c.principal_id WHERE c.name = '##MS_PolicyEventProcessingLogin##'
SELECT a.name, b.permission_name FROM sys.server_principals a INNER JOIN sys.server_permissions b ON a.principal_id = b.grantee_principal_id INNER JOIN sys.server_principals c ON b.grantor_principal_id = c.principal_id WHERE c.name = '##MS_AgentSigningCertificate##'
Per ogni account di accesso visualizzato nei risultati della query, eseguire un'istruzione come la seguente per revocare tali autorizzazioni.
Ad esempio, se una delle query restituisce i risultati seguenti:
Nome: Nome autorizzazione NT SERVICE\MSSQL$TEST: CONTROL
In questo caso, eseguire una delle istruzioni seguenti:
REVOKE CONTROL ON LOGIN::[##MS_PolicyEventProcessingLogin##] TO [NT SERVICE\MSSQL$TEST] AS [##MS_PolicyEventProcessingLogin##]
REVOKE CONTROL ON LOGIN::[##MS_AgentSigningCertificate##] TO [NT SERVICE\MSSQL$TEST] AS [##MS_AgentSigningCertificate]
Rimuovere TF 902 dai parametri di avvio e quindi riavviare SQL Server. Dopo l'avvio di SQL Server senza TF 902, lo script di aggiornamento verrà eseguito di nuovo.
Se lo script di aggiornamento viene completato correttamente, l'aggiornamento di SP o CU è completato. È possibile controllare il log degli errori di SQL Server e la cartella bootstrap per verificare l'installazione completata.
Se lo script di aggiornamento non riesce di nuovo, controllare il log degli errori di SQL Server per ulteriori voci di errore e quindi risolvere i nuovi errori.