This script fixes an error reporting problem that occurs after moving a System Center Operations Manager 2007 database to a new computer.

After you attach the OperationsManager database by following the To attach the database procedure in the Operations Manager 2007 Backup and Recovery topic, you must run this script. Running this script ensures correct logging of error messages on the new SQL Server-based computer. To run the script:

1.

Copy and paste this script to a file that is accessible by the SQL Server-based computer that is now hosting the OperationsManager database.

2.

In the Microsoft SQL Server Management Studio, click File, click Open, and then click File.

3.

In the Open File dialog box, select the file that contains the script, and then click OK.

4.

Click Execute to run the script. 

5.

View the results pane to ensure that the script ran successfully.

Visual Basic
Edit|Remove
-----------------------------------------------------------------------------
--  (c) Copyright 2004-2006 Microsoft Corporation, All Rights Reserved     --
--                                                                         --
--  File:       ErrorMessages.sql                                          --
--                                                                         --
--  Contents:  Contains MOM-specific error messages                        --
-----------------------------------------------------------------------------

-----------------------------------------
--    MOMv3 messages are 77798xxxx     --
-----------------------------------------


-----------------------------------------------
-- Discovery range: 77798-0000 to 77798-0049 --
-----------------------------------------------
-- Managed type doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980000, 
@msgtext = N'The specified managed type doesn''t exist.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Relationship type doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980001, 
@msgtext = N'The specified relationship type doesn''t exist.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Source entity of the relationship doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980002, 
@msgtext = N'The specified relationship doesn''t have a valid source.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Target entity of the relationship doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980003, 
@msgtext = N'The specified relationship doesn''t have a valid target.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Discovery data from invalid managed entity is dropped.
EXECUTE sp_addmessage @msgnum = 777980004, 
@msgtext = N'Discovery data has been received from a rule targeted to a
non-existent entity. The discovery data will be dropped.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Invalid relationship rejected by cycle detection.
EXECUTE sp_addmessage @msgnum = 777980005, 
@msgtext = N'Invalid relationship rejected by cycle detection.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Discovery data generated by invalid connector.
EXECUTE sp_addmessage @msgnum = 777980006, 
@msgtext = N'Discovery data generated by invalid connector:%s.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Discovery data generated by invalid rule, task, discovery.
EXECUTE sp_addmessage @msgnum = 777980007, 
@msgtext = N'Discovery data generated by invalid discovery source. Id:%s.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Health service should not generate data about this managed object.
EXECUTE sp_addmessage @msgnum = 777980008, 
@msgtext = N'Health service ( %s ) should not generate data about this
managed object ( %s ).', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Health service should not generate data about this relationship object.
EXECUTE sp_addmessage @msgnum = 777980009, 
@msgtext = N'Health service ( %s ) should not generate data about this
relationship object between ( %s and %s ).', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

---------------------------------------------------------------------
-- Availability & Maintenance Mode range: 77798-0050 to 77798-0099 --
---------------------------------------------------------------------

-- Can not set availability on a health service that doesn't exist.
EXECUTE sp_addmessage @msgnum = 777980050, 
@msgtext = N'Cannot set availability on a health service that doesn''t
exist.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Managed entity is not currently in maintenance mode
EXECUTE sp_addmessage @msgnum = 777980051, 
@msgtext = N'Managed entity is not currently in maintenance mode.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- End time has to be greater than start time
EXECUTE sp_addmessage @msgnum = 777980052, 
@msgtext = N'The maintenance mode scheduled end time has to be greater than
the start time.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- ScheduledEndTime can't be in the past
EXECUTE sp_addmessage @msgnum = 777980053, 
@msgtext = N'Cannot set scheduled end time to a time in the past', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO


-----------------------------------------------
-- UserRole range: 77798-0100 to 77798-0199 --
-----------------------------------------------

-- UserRoleAdministratorAlreadyExistsException
EXECUTE sp_addmessage @msgnum = 777980100, 
@msgtext = N'A user role with the administrator profile already exists.
Cannot create another user role with the same profile.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- UserRoleSystemDeleteException
EXECUTE sp_addmessage @msgnum = 777980101, 
@msgtext = N'Cannot delete system user roles.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- UserRoleSystemException
EXECUTE sp_addmessage @msgnum = 777980102, 
@msgtext = N'Cannot create user roles with IsSystem specified.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- NULL is not a valid Group Id for the Scope specified
EXECUTE sp_addmessage @msgnum = 777980103, 
@msgtext = N'NULL is not a valid GroupId for the Scope specified.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- NULL is not a valid TypeId for the Scope specified
EXECUTE sp_addmessage @msgnum = 777980104, 
@msgtext = N'NULL is not a valid TypeId for the Scope specified.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO



------------------------------------------------------
-- Operational Data range: 77798-0200 to 77798-0299 --
------------------------------------------------------

-- Invalid Timestamp
EXECUTE sp_addmessage @msgnum = 777980200, 
@msgtext = N'Request to update alert ignored due to invalid TimeModified', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Invalid Timestamp
EXECUTE sp_addmessage @msgnum = 777980201, 
@msgtext = N'Request to update alert ignored due to mismatch in
BaseManagedEntityId', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Invalid MonitorId
EXECUTE sp_addmessage @msgnum = 777980202, 
@msgtext = N'Cannot create Alert. Invalid MonitorId.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Invalid RuleId
EXECUTE sp_addmessage @msgnum = 777980203, 
@msgtext = N'Cannot create Alert. Invalid RuleId.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- NULL category in Monitor
EXECUTE sp_addmessage @msgnum = 777980204, 
@msgtext = N'Cannot create Alert. Monitor Category cannot be NULL', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- NULL category in Rule
EXECUTE sp_addmessage @msgnum = 777980205, 
@msgtext = N'Cannot create Alert. Rule Category cannot be NULL.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Trying to update Alert that doesn't exist in the table.
EXECUTE sp_addmessage @msgnum = 777980206, 
@msgtext = N'No alert matches the given AlertId.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Alert resolution state shortcut key has to be unique.
EXECUTE sp_addmessage @msgnum = 777980207, 
@msgtext = N'Alert resolution state shortcut key has to be unique.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- A predefined alert resolution state can not be updated.
EXECUTE sp_addmessage @msgnum = 777980208, 
@msgtext = N'A predefined alert resolution state can not be updated.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Only the action account secure data type can be associated with the action
-- account secure reference.
EXECUTE sp_addmessage @msgnum = 777980209, 
@msgtext = N'Action account secure data must be paired with the action
account secure reference.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Cannot associated a health service with a credential that has no password.
-- This happens when the secure data object was inserted by a health service.
EXECUTE sp_addmessage @msgnum = 777980210, 
@msgtext = N'-- Cannot associated a health service with a credential that
has no password. This happens when the secure data object was inserted by
a health service.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

------------------------------------------------------
-- ManagementPack Data range: 77798-0300 to 77798-0399 --
------------------------------------------------------

-- Duplicate Name For ManagedType 
EXECUTE sp_addmessage @msgnum = 777980300, 
@msgtext = N'ManagementPack cannot be imported because it contains a
Managed Type with the same name as an existing type: %s', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Duplicate Name For RelationshipType 
EXECUTE sp_addmessage @msgnum = 777980301, 
@msgtext = N'ManagementPack cannot be imported because it contains a
Relationship Type with the same name as an existing type: %s', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Update specified, but no prior version of Management Pack exists 
EXECUTE sp_addmessage @msgnum = 777980302, 
@msgtext = N'ManagementPack cannot be updated because it has not installed', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Update specified, but no ManagementPack is sealed
EXECUTE sp_addmessage @msgnum = 777980303, 
@msgtext = N'ManagementPack cannot be updated because it is sealed', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

--  Update specified, but  Timestamp is too old
EXECUTE sp_addmessage @msgnum = 777980304, 
@msgtext = N'ManagementPack cannot be updated because TimeModified is not
the latest', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

--  Update specified, but  Timestamp is too old
EXECUTE sp_addmessage @msgnum = 777980305, 
@msgtext = N'TypeCacheSelect failed due to update of data during transaction', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

--  Update specified, but  Timestamp is too old
EXECUTE sp_addmessage @msgnum = 777980306, 
@msgtext = N'ManagementPack cannot be updated because %s has been modified
more recently.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

------------------------------------------------------
-- Connectors & MCF range: 77798-0400 to 77798-0449 --
------------------------------------------------------
-- Connector not initialized
EXECUTE sp_addmessage @msgnum = 777980400, 
@msgtext = N'Cannot perform operation: Connector does not exist or is not
initialized', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Connector does not own object
EXECUTE sp_addmessage @msgnum = 777980401, 
@msgtext = N'Cannot perform operation: Connector does not own object', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Connector is alredy in given IsInitialized state
EXECUTE sp_addmessage @msgnum = 777980402, 
@msgtext = N'Connector is already the given IsInitialized State', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Connector is not unitialized
EXECUTE sp_addmessage @msgnum = 777980403, 
@msgtext = N'Cannot perform operation: Connector does not exist or is not
Uninitialized', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO

-- Collision in setting the connector id.
EXECUTE sp_addmessage @msgnum = 777980404, 
@msgtext = N'A collision happened while setting the connector id of alerts.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO


------------------------------------------------------
-- Agent management: 77798-0450 to 77798-0499 --
------------------------------------------------------
-- Connector not initialized
EXECUTE sp_addmessage @msgnum = 777980450, 
@msgtext = N'There is an existing pending action for agent %s. You must
process this pending action before a new pending action can be inserted.', 
@severity = 16, @lang = 'us_english', @with_log = false, @replace = 'REPLACE'
GO