Applications Systems

Resolve inconsistencies in SAM SQL tables related to a known Microsoft issue that causes DBCC CHECKTABLE errors

This article describes how to handle a known Microsoft SQL issue that creates inconsistency in SQL tables used by SAM, as indicated by a Database Integrity Check error message.

First published date

12/13/2019 9:44 PM

Last published date

1/4/2021 11:00 PM

Overview

This article describes how to fix inconsistencies in a SAM SQL table if a known Microsoft issue results in a Database Integrity Check failure. For example, you may encounter the following error for the APM_ApplicationTemplate table that stores SAM template settings:
 
DBCC CHECKTABLE (SolarWindsOrion.dbo.APM_ApplicationTemplate) found 112 errors and repaired 0 errors

 

Product section

Server Application Monitor

Cause

A known MS SQL issue can create inconsistencies in the following SAM tables:
  • APM_ApplicationTemplate
  • APM_ComponentDefinition
  • APM_ExternalSetting
To learn more about this known issue, see Changing the data type and then updating the table with more than 4,000 records causes database corruption (© 2019 Microsoft Corp., available at https://support.microsoft.com/, obtained on December 13, 2019).

Resolution

IMPORTANT: Before proceeding, back up the Orion database, as described in Back up the SolarWinds Orion database using SQL Server Management Studio.

Per the Microsoft link above, execute the following query on the Orion database:
-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

exec sp_tableoption 'dbo.APM_ExternalSetting', 'large value types out of row', '1'
exec sp_tableoption 'dbo.APM_ApplicationTemplate', 'large value types out of row', '1'
exec sp_tableoption 'dbo.APM_ComponentDefinition', 'large value types out of row', '1'
If issues continue after running this query, revert these changes by executing the same query but using 0 as the default value instead of 1. Contact Microsoft for further assistance.