Network Management

Truncate the SolarWindsOrionLog tables in OLV/LA

The SolarWinds Orion Log Viewer database is growing in size and tables need to be truncated to reclaim space.

First published date

1/4/2021 5:02 PM

Last published date

2/7/2025 6:16 PM

Overview

If there are a large number of devices sending Syslogs and Traps to the SolarWinds Server, if specific devices are sending a significant number of Syslogs and Traps, or if the retention settings have been increased from the default values of 7 days, you may find that your database has grown significantly. The database may be growing at a rate of 10GB or more per hour.

This article works for the Log Analyzer (LA) and Orion Log Viewer (OLV) Syslog/Trap tables.
The queries are not compatible with the Legacy Syslog/Trap Viewer database. 

Please note that these steps do not reduce the size of the main database file. SolarWinds recommends that you only shrink transaction log files. Shrinking data files typically results in fragmented indices, slow performance, data loss, and problems with writing data to the database. If this is needed, please review this article from Microsoft:

Shrink a database (© 2023 Microsoft, available at https://learn.microsoft.com/, obtained on April 14, 2023)

Product section

Network Performance Monitor

Cause

Causes for database growth:
  • Too many devices configured to send messages
  • Specific devices sending too many messages
  • Discard rules not configured
  • Retention settings adjusted greater than the default of 7 days

Resolution

Truncate the SolarWindsOrionLog tables and set the logs retention to 7 days.
  • Please ensure there is a recent Orion database backup.
  • Stop the Orion services on all Orion servers using the Orion Services Manager.
  • Open the Orion Database Manager.
  • Right-click on the SolarWindsOrionLog database and select New Query.
  • Run the SQL query below:
-- 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 'Truncate Table [dbo].[' + table_name +']' FROM Information_Schema.tables where table_name like 'OrionLog_LogEntryMessage_%'
and table_name not like 'OrionLog_LogEntryMessageSource'
and table_type ='BASE TABLE'
  • Copy all the SQL query results to a Notepad.
  • Add the SQL query results on the SQL statements below:
-- 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.

Truncate Table [dbo].[OrionLog_LogEntry]
Truncate Table [dbo].[OrionLog_LogEntryFieldValue]
For additional resources, see the following: