Submit a ticketCall us

AnnouncementsAre You “Flying Blind?”

When it comes to your complex IT infrastructure, you want to ensure you have a good grasp of what’s going on to avoid any fire drills that result from guesswork. Read our white paper to learn how proactively monitoring your IT environment can help your organization while giving you peace of mind.

Get your free white paper.

Home > Success Center > Server & Application Monitor (SAM) > SAM - Knowledgebase Articles > Unable to install SAM if the database contains old data

Unable to install SAM if the database contains old data

Overview

One of the following errors appear during SAM installation where the previous version of SAM was installed:

Your database includes data from APM older than 3.0.

Invalid object name 'dbo.APM_ProcessEvidence_Detail'.

 

The original name of SolarWinds SAM was APM so you may still see references to "APM" in SAM log files and database elements.

Environment

SAM 6.2 and later

Cause 

A previous SAM version is installed that uses the same database. 

Resolution

Warning: SolarWinds strongly recommends that you backup your database before doing any work as this will make a permanent change to your database.

  1. Stop all Orion services.
  2. Log into SQL Server Management Studio and open the SolarWinds database.
  3. Execute the following script:
    DECLARE @table_object_id int
    DECLARE @table_name varchar(max)
    DECLARE @table_type varchar(max)
    DECLARE @stmt nvarchar(max)
    
    DECLARE table_cursor CURSOR FAST_FORWARD FOR
    SELECT o.object_id, o.name, o.[type]
    FROM sys.objects o
    WHERE o.[type] IN ('FN','TF','V','P','U') AND o.name LIKE 'APM_%' AND o.name NOT LIKE '%APM_Hardware%'
    ORDER BY CASE o.[type] WHEN 'U' THEN 'z' ELSE o.[type] END
    
    OPEN table_cursor
    
    FETCH NEXT FROM table_cursor INTO @table_object_id, @table_name, @table_type
    WHILE @@FETCH_STATUS=0
    
    BEGIN
    SET @stmt = CASE @table_type
    WHEN 'V' THEN 'VIEW'
    WHEN 'P' THEN 'PROCEDURE'
    WHEN 'FN' THEN 'FUNCTION'
    WHEN 'TF' THEN 'FUNCTION'
    ELSE 'TABLE'
    END
    
    SET @stmt = 'DROP '+@stmt+' ['+@table_name+']'
    PRINT @stmt
    EXEC [dbo].sp_executesql @statement = @stmt
    FETCH NEXT FROM table_cursor INTO @table_object_id, @table_name, @table_type
    END
    
    CLOSE table_cursor
    
    DEALLOCATE table_cursor
    
    IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetApmDbVersion]') AND xtype in (N'FN', N'IF', N'TF'))
    BEGIN
    DROP FUNCTION GetApmDbVersion
    END
  4. Reinstall SAM.
Last modified

Tags

Classifications

Public