Submit a ticketCall us

Bridging the ITSM Divide
Integrated help desk and remote support software for faster resolution

Join us on Wednesday, November 29, 2017 at 11 a.m. CT, as we discuss the benefits of effectively integrating your help desk software with remote support solutions to help increase the efficiency of IT administration, improve communication, and decrease mean time to resolution (MTTR) for IT issues of all sizes. This directly impacts end-user satisfaction and your business’ bottom line. Register Now.

Home > Success Center > Network Performance Monitor (NPM) > Selectively delete syslogs messages from the database

Selectively delete syslogs messages from the database

Created by Gary O'Donovan, last modified by MindTouch on Jun 23, 2016

Views: 612 Votes: 3 Revisions: 7

Overview

This article describes the issue when you find that your database is full and syslogs are consuming a large amount of space. You can selectively delete a certain amount of syslog messages without truncating the whole table. To do this, follow the steps below. 

 

Environment

All versions of NPM

 

Cause 

This issue occurs due to a large amount of syslogs messages being received and database running out of space.

Resolution

Note: Before running the query below, make sure to backup your database.

  1. Download SQL Server Management Studio.
  2. Run the following query on the database:

Delete from Syslog Where datetime <= '4/24/2016'

The Date above will determine how many syslogs you will keep , the above query will remove all Syslogs before '4/24/2016'

 

Batch File

For very large tables, we can use a Batch File:

 

use [SolawindsOrion]/* PUT YOUR DATABASE NAME HERE */

GO

DECLARE @batch INT

SET @batch = 10000 /* SIZE OF BATCH */

DECLARE @cnt INT

SET @cnt = 0 /* START OF COUNTER */

DECLARE @cntmax INT

SET @cntmax = 10 /* NUMBER OF BATCHES */

WHILE @cnt < @cntmax

BEGIN

  SET @cnt = @cnt + 1

  DELETE TOP(@batch) FROM dbo.SysLog

WHERE  DATETIME <= '4/24/2016'    /* ACTUAL DELETE QUERY - ADJUST */

END

 

Note: For very large syslog tables, you may have to run this query multiple times.

Increase Batch Size ie from 1000 to 4000 to Increase Deletion  time.

 

See How to delete data in batches from large SQL database tables:

https://support.solarwinds.com/Succe...atabase_tables

 

Truncate

If you want to delete all existing Syslog messages, use the following query:

Truncate Table Syslog

 

Video

Managing Syslog & Traps in Orion NPM - Solarwinds Certified Professional Program

https://www.youtube.com/watch?v=i9lZgvNbKEg

 

Last modified

Tags

Classifications

Public