MGMT Server Database Maintenance

Hello. Is there some manual, how to properly make management server database maintenance? Is there some settings for automatic DB maintenance? Im asking, because our database became too big. Thank You very much.

If you go to settings on the Recast Management Sever portal, you can change the MaxAuditLogAge and MaxSnapshotAge so it will delete records older than the time set.

1 Like

So if it is set to 00:00:00 does that mean there is no maintenance set?

I apparently missed that setting as well. Any idea on when the management server will go in and clean up the older records?

If it’s set to all 0’s there is no maintenance set and will keep all records. If you change that setting, it will delete the records at midnight at the set interval.

1 Like

Spiff. Thank you, Courtney

Hello. But we stil have problem. Run of the scheduled task ends with an error. Returned code 214794201. Fuj. In Application Event log error Source = .NET Runtime, Event ID 1000, … Failed executing DbCommand (30,926ms) [Parameters=[@p0=’?’ (DbType = Int64)], CommandType=‘Text’, CommandTimeout=‘30’] …
Runs from Powershell … “Invoke-RestMethod https://our_server.contoso.com:444/api/TaskScheduler/RunAuditLogCleanupTask -Method Post -UseDefaultCredentials” many times with error: “Invoke-RestMethod: Response status code does not indicate success: 500 (Internal Server Error)”. (error Event recorde same). Then “maybe” one time success. DB size 80 GB. And more. Any idea? Please.Thanks

Hello,

Another option that might be helpful is switching the recovery model for your ‘RecastManagementServer’ database to simple recovery. This reduces space being taken up by log files.

More info: Recovery Models (SQL Server) - SQL Server | Microsoft Docs

If the storage for the DB is nearly full, I would recommend adding additional storage before making the change. You can reduce allocated storage after switching to simple.

Please consult your SQL admin before proceeding.

Best,

Branden

1 Like

Hello Branden. First, thank You for Your answer. Me and StandaE, We are both from the same company, so I will react this time. We have 114,37 GB Free Space on DB. DB was set to simple. Access Rights are DB_owner, so everything looks properly set and we are still facing this issue. Maybe DB command timeout should be increased, because 30 seconds are simply not enough to finnish cleanup request. Is there some way, how we can increase this setting? We tried to look for it and didn’t found it. Do You know, how, please? Many thanks to You.

I’ll see what I can find out for you. If you’d like, you could try running this command against the RecastManagmentServer database which will attempt to delete audit log entries older than 7 days.

DECLARE @Rows INT
Declare @Now date Set @Now  = Getdate()-7
SET @Rows = 1WHILE (@Rows > 0)
BEGIN
    DELETE TOP (5000) from ActionExecutionResults
	where Id in (Select AER.Id from ActionExecutionResults AER
				join [dbo].[ActionExecutions] AE on AER.ActionExecutionID = AE.ID
				Where AE.Created < @Now)    SET @Rows = @@ROWCOUNT
END

Once the audit log storage is a bit smaller the scheduled task may be successful with its current settings.

1 Like

Just a heads up, it could take hours to complete depending on how many rows it has to go through.

1 Like

HI. Many thanks. We will try it…