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
Last published date
Overview
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
Cause
- 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
- 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]
- Copy the SQL queries and paste them back to the Orion Database Manager.
- Execute all the SQL queries, including the "Truncate Table [dbo].[OrionLog_LogEntry]" and "Truncate Table [dbo].[OrionLog_LogEntryFieldValue]"
- Set the logs retention to the recommended 7 days if it's not already set to 7 days.
- Run the Orion Database Maintenance utility.
- Identify Top Talkers that are sending the most messages:
- To limit the number of messages received, configure discard rules for syslogs and traps: