How to reduce Veeam ONE Database size

Veeam ONE is the monitoring and reporting component of the popular Veeam Availability Suite.

The default installation stores the monitoring data within a Microsoft SQL Express database. Depending on version this will either be a SQL 2008 or SQL 2012 Express which has a maximum size of 10 GB.

I’ve seen an issue in a couple of our customer environments that DB size can grow to the maximum size. Reason being due to a high number of events being generated from a Hyper-V node windows security log. If you are currently running version 8 it is recommended to install the following patch which should resolve the underlying issue from occurring again.

Link to Veeam ONE v8 Update 2

To reduce the size of the database follow the below steps:

Procedure has been tested on a Veeam ONE v8, running Microsoft SQL 2008 R2 Express on Windows Server 2012 R2.

PLEASE NOTE: It is critical to perform a backup of the database before carrying out this procedure. The official line from Veeam is to log a call with support if you come across this issue. So you may want to log a support call as this method may be unsupported.

Due to the high quantity of transaction logs generated during this process I would recommend to delete at maximum 2 weeks data at a time. Then backup the database and then shrink the logs.

1. Stop Veeam ONE Services
Log onto the Veeam One Server
Open powershell as administrator

stop-service VeeamDCS
stop-service VeeamRSS

2. Backup your Veeam ONE SQL database
If you unsure how to do so do this, the following Veeam Knowledge Base article provides instructions
Or alternatively execute the following SQL query

BACKUP DATABASE [VeeamOne] TO  DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.VEEAMSQL2008R2\MSSQL\Backup\veeamone.bak' WITH NOFORMAT, NOINIT,  NAME = N'VeeamOne-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10

3. Identify a range of records to delete
Run the following SQL query to identify a suitable date range. To query to see how many rows are affected

USE [VeeamOne]
SELECT * from monitor.Event
where time <'2015-06-06';

4. Execute deletion of required records
If you are happy with the returned values that will be delete.
Run the following SQL query to delete records earlier than the date range specified

USE [VeeamOne]
DELETE from monitor.Event
where time <'2015-06-06';

5. Backup SQL DB again

6. Shrink Transaction Log

USE [VeeamOne]

8. This step should be carried out only once the database has been trimmed down to a suitable size

USE [VeeamOne]

9. Now it should be ok to restart Veeam ONE services to restore service

start-service VeeamDCS
start-service VeeamRSS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s