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.
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.
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
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.
Just a heads up, it could take hours to complete depending on how many rows it has to go through.
HI. Many thanks. We will try itâŚ