When SCOM is installed – it doesn’t just create the databases on the SQL instance – it adds data to the sysmessages view for different error scenarios, to the Master database for the instance.
This is why after moving a database, or restoring a DB backup to a rebuilt SQL server, or when using SQL AlwaysOn and failing over to another instance - we might end up missing this data.
These are important because they give very good detailed data about the error and how to resolve it. If you see these – you need to update your SQL instance with some scripts. Or – if you KNOW you are using SQL AlwaysOn, or migrating a DB – be PROACTIVE and handle this manually, up front.
Examples of these events on the SQL server:
Log Name: Application
Source: MSSQL$I01
Date: 10/23/2010 5:40:14 PM
Event ID: 18054
Task Category: Server
Level: Error
Keywords: Classic
User: OPSMGRmsaa
Computer: SQLDB1.opsmgr.net
Description:
Error 777980007, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.
You might also notice some truncated events in the OpsMgr event log, on your RMS or management servers:
Event Type: Warning
Event Source: DataAccessLayer
Event Category: None
Event ID: 33333
Date: 10/23/2010
Time: 5:40:13 PM
User: N/A
Computer: OMMS3
Description:
Data Access Layer rejected retry on SqlError:
Request: p_DiscoverySourceUpsert -- (DiscoverySourceId=f0c57af0-927a-335f-1f74-3a3f1f5ca7cd), (DiscoverySourceType=0), (DiscoverySourceObjectId=74fb2fa8-94e5-264d-5f7e-57839f40de0f), (IsSnapshot=True), (TimeGenerated=10/23/2010 10:37:36 PM), (BoundManagedEntityId=3304d59d-5af5-ba80-5ba7-d13a07ed21d4), (IsDiscoveryPackageStale=), (RETURN_VALUE=1)
Class: 16
Number: 18054
Message: Error 777980007, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.
Event Type: Error
Event Source: Health Service Modules
Event Category: None
Event ID: 10801
Date: 10/23/2010
Time: 5:40:13 PM
User: N/A
Computer: OMMS3
Description:
Discovery data couldn't be inserted to the database. This could have happened because of one of the following reasons:- Discovery data is stale. The discovery data is generated by an MP recently deleted.
- Database connectivity problems or database running out of space.
- Discovery data received is not valid.The following details should help to further diagnose:
DiscoveryId: 74fb2fa8-94e5-264d-5f7e-57839f40de0f
HealthServiceId: bf43c6a9-8f4b-5d6d-5689-4e29d56fed88
Error 777980007, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage..
I have created some SQL scripts which are taken from the initial installation files, and you can download them below. You simply run them in SQL Management studio to get this data back.
These are for SCOM 2016 ONLY!!!!
Download link: https://gallery.technet.microsoft.com/SQL-to-fix-event-18054-4d6d9ec1
SCOM 2012R2 files are here: https://blogs.technet.microsoft.com/kevinholman/2016/02/10/event-18054-errors-in-the-sql-application-log-in-scom-2012-r2-deployments/