Now you’re less likely to miss what’s been brewing in our knowledge base with this weekly digest
Please, try again later.
When the Veeam ONE database is located in a SQL Express instance, if the database reaches the maximum allowed size, Veeam ONE will not be able to continue data collection, thus affecting data accuracy and alarm generation.
If you choose to host the Veeam ONE database on Microsoft SQL Server Express Edition, be informed that this edition has a 10 GB database size limitation. For details, see Editions and Supported Features for SQL Server.
The best way to resolve this database size limit is to upgrade the SQL Instance from Express edition to Standard or Enterprise edition.
Alternatively, move the Veeam ONE database to another SQL Instance that uses Standard or Enterprise edition. The procedure for configuring Veeam ONE to use a new SQL Server connection is described in KB1599.
If upgrading to a licensed version of SQL is not feasible, the alternative solution is to reduce the amount of retained performance data history, reducing the database size below the maximum limit imposed by SQL Express.
Below are two methods to change the Performance Data Retention:
You can delete past performance data by lowering the performance data retention within the Veeam ONE Settings Utility by following the method documented in KB2051.
Note: When retention is enforced, performance data within the database is removed, however, the actual database file on disk will not become smaller. If you want the Veeam ONE database file to become smaller on disk, you must perform a Shrink Database operation against the Veeam ONE database after reducing performance data retention. **The SQL Script in Method 2 performs a shrink operation.
If the Veeam ONE Setting Utility is not available or cannot be used for other reasons, the retention value can be set and enforced using the following SQL Script. Follow these steps to reduce the database size:
-- Specify the new Retention Policy (how many months to keep, default = 12)
DECLARE @NewRetentionMonths INT = 12;
--
--StrictCleanup value of 0 is recommended for most environments. Set to 1 for a more aggressive cleanup that will take longer.
DECLARE @StrictCleanup INT = 0;
--
--Do not modify anything below this line!--
SET NOCOUNT ON;
BEGIN TRY
-- Validate Retention Policy
IF (@NewRetentionMonths NOT BETWEEN 1 AND 36)
BEGIN
RAISERROR('ERROR: The Retention Policy value must be within range of 1-36 months', 15, 15);
RETURN;
END
DECLARE @CurrentRetentionMonths INT = (SELECT TOP 1 COALESCE(RetentionPolicyPeriod, 12) FROM common.ServerSettings);
PRINT CONCAT('Current Retention Policy: ', @CurrentRetentionMonths, ' months. New Retention Policy: ', @NewRetentionMonths, ' months.');
IF @NewRetentionMonths < @CurrentRetentionMonths
BEGIN
DECLARE @RetentionDate DATETIME = DATEADD(MONTH, -@NewRetentionMonths, GETUTCDATE());
PRINT CONCAT('Starting the PerfSample data cleanup. Keeping data newer than ', CAST(@RetentionDate AS NVARCHAR));
-- Cleanup for unpartitioned data
IF OBJECT_ID(N'[monitor].[PerfSampleLow]', N'U') IS NOT NULL
BEGIN
RAISERROR('Clearing unpartitioned data', 0, 1) WITH NOWAIT;
EXEC monitor.sp_perf_sample_delete 2, @RetentionDate;
EXEC monitor.sp_perf_sample_delete 3, @RetentionDate;
END
ELSE
BEGIN
-- Cleanup for partitioned data
RAISERROR('Clearing partitioned data', 0, 1) WITH NOWAIT;
DECLARE @partitionName NVARCHAR(32);
DECLARE cur CURSOR LOCAL FOR
SELECT 'monitor.' + [name]
FROM sys.tables
WHERE name LIKE 'PerfSampleLow%' OR name LIKE 'PerfSampleDay%';
OPEN cur;
FETCH NEXT FROM cur INTO @partitionName;
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @sql NVARCHAR(MAX);
-- Truncate if applicable
SET @sql = N'IF (SELECT MAX([timestamp]) FROM ' + @partitionName + ') < @RetentionDate TRUNCATE TABLE ' + @partitionName;
EXEC sp_executesql @sql, N'@RetentionDate DATETIME', @RetentionDate;
-- Delete records older than retention date if strict cleanup is enabled
IF (@StrictCleanup = 1)
BEGIN
SET @sql = N'DELETE FROM ' + @partitionName + ' WHERE [timestamp] < @RetentionDate';
EXEC sp_executesql @sql, N'@RetentionDate DATETIME', @RetentionDate;
-- Shrink database if applicable
IF (SELECT recovery_model FROM sys.databases WHERE database_id = DB_ID()) = 3
DBCC SHRINKDATABASE (0, TRUNCATEONLY) WITH NO_INFOMSGS;
END
FETCH NEXT FROM cur INTO @partitionName;
END
CLOSE cur;
END
PRINT 'PerfSample data cleanup is finished.';
END
PRINT 'Updating the Retention Policy parameters.';
UPDATE common.ServerSettings SET RetentionPolicyPeriod = @NewRetentionMonths;
PRINT 'Shrinking the Veeam ONE Database file(s).';
DBCC SHRINKDATABASE (0) WITH NO_INFOMSGS;
PRINT 'Done!';
END TRY
BEGIN CATCH
PRINT CONCAT('An error occurred: ', ERROR_MESSAGE());
END CATCH;
GO
Before applying the approaches described below, the database must be in an operational state, either by reducing its size using the methods described above in this article or by migrating the database to an edition of Microsoft SQL that does not have the 10GB size limit.
The Data Collection Mode determines the frequency of data collection. The Data Collection Mode is configured during initial deployment and can be modified after deployment using the Veeam ONE Settings Utility > Scalability. Within the Scalability options, it is also possible to limit which Performance Metrics are collected.
You can modify the historical data retention period by adjusting the settings in Veeam ONE Settings utility > Retention Policy Period section.
Your feedback has been received and will be reviewed.
Please, try again later.
Please try select less.
This form is only for KB Feedback/Suggestions, if you need help with the software open a support case
Your feedback has been received and will be reviewed.
Please, try again later.