Large SQL data source

avatar
sekr
Disabled

Hello,


We are running Remote Desktop Manager installed on Remote Desktop services solution where users start if as an RemoteApp.


As a datasource we use a Microsoft SQL server, where we have made an powershell script that exports all of our servers from our CMDB into the SQL database via the remote desktop manager cmdlets. This script runs every 2 hours.


The problem is that after a while the database has gotten very large, and the table ConenctionHistory specifically is quite large. (the table is 3,6 GB. out of 4,2 GB. total size of the database)
What is the recommended way to purge this table? Can I just do it directly in the database without breaking anything?
I see that there are some clean options under the Administration tab in the Remote desktop manager to clean up history, but it's very important that we don't delete anything in the table ConnectionLog which we use as audit history, and automated way to do is required.

All Comments (2)

avatar

Hello,

RDM's own cleanup features are quite simple. The one for the ConnectionHistory performs a


delete from ConnectionHistory where HistoryType != 'D' and ModifiedDate <= ?

HistoryType can be

I = Inserted
U = Updated
D = Deleted
R = Resurrect (restored after a delete)

My recommendation would be to perform your powershell script using a RDM copy that is operated by a special user account not used by anyone, and to just delete the ConnectionHistory records that have been created by that account (ModifiedUsername column). That way, you will preserve the manual modifications applied by your staff.


Best regards,

Maurice

avatar

It worked, thanks!