Applications Systems

How to delete SAM application monitors from the database

This article explains the proper steps to delete and SAM application monitor directly from the database

First published date

11/5/2019 7:52 PM

Last published date

3/24/2022 12:45 PM

Overview

This article overviews the proper steps to delete and SAM application monitor directly from the database if needed.

Situations this can be useful for:
  • If the corresponding template for an application monitor was deleted the application may not show properly under the manage application monitors page
  • If there are website issues and we need to delete applications
  • If Solarwinds is heavily over polled on SAM applications and the website functionality is negatively impacted because of this

Product section

Server Application Monitor

Resolution

  1. Take a backup of your database.
  2. Find application ID from the application details page using the URL in your browser. Please see the screenshot below. In this example the application ID = 4
  3. Connect to one of your polling engines and open up DatabaseManager.exe found by default in  C:\ProgramFiles(x86)\Solarwinds\Orion\
  4. Then add default server to connect to your Orion database instance.
  5. You can right-click on this database name to run a query.
  6. Open the Orion Sevice Manager utility. This is located in the Solarwinds Orion folder in the Start Menu on the server.
  7. Stop Orion services by Selecting the "Shutdown Everything" button in the Orion Service Manager
  8. Once all the services show as stopped the entry can be deleted using the application ID that was found. Note: Dependencies can stay running and it is not required to stop these.
  9. Run this query in the database manager to find and confirm the application with the ID you found. Replace x, y, or z with application IDs.
/* 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. */

SELECT * FROM [dbo].[APM_Application]
WHERE [ID] IN (x, y, z)
  1. Run the following delete statement to delete those applications:
DELETE FROM [dbo].[APM_Application] WHERE [ID] IN (x, y, z)
  1. Select "Start everything" using the Orion Service Manager


 

More Advanced Queries

--Select/Delete ALL applications with a specific node name pattern
SELECT * FROM [APM_Application] WHERE NodeID IN (SELECT NodeID FROM NodesData WHERE Caption LIKE 'YourNodeNameGoesHERE') 
--Select/Delete ALL applications with a specific node name pattern AND application name pattern
SELECT * FROM [APM_Application] WHERE NodeID IN (SELECT NodeID FROM NodesData WHERE Caption LIKE 'YourNodeNameGoesHERE') AND Name LIKE 'YourApplicationNameGoesHERE'

/* 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. */