Submit a ticketCall us

Announcing NCM 7.7
With NCM 7.7, you can examine the rules that make up an access control list for a Cisco ASA device. Then you can apply filters to display only rules that meet the specified criteria, order the rules by line number or by the hit count, and much more.
See new features and improvements.

Home > Success Center > Server & Application Monitor (SAM) > 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'.

Environment

SAM v6.0 and later

Cause 

There is a previous SAM version installed using the same database and data needs to be removed.

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 in to 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

    Note: To copy content without line numbers, hover over the text and click the view source button (View Source). This opens a new window where you can select and copy text without any formatting or line numbering.

     

  4. Reinstall SAM.
Last modified
18:15, 23 Nov 2016

Tags

Classifications

Public