Old entries in ConnectionLog table

Old entries in ConnectionLog table

avatar

We see a lot of entries in our db.ConnectionLog table. Many of them seem to refer to deleted entries to my theory is that they cannot be cleaned up with the "Clean up activity logs"

Do you have any script available that can handle this?

All Comments (3)

avatar

Can you please verify that you are selecting All vaults & all user vaults when running the Clean Up Activity Logs

Also make sure that Include Administration Logs is checked. With the tests I've made all looks to be deleting properly.

forum image

Stéfane Lavergne

avatar

Yes, I included them all. What remains in the database seem to be alot logs related to non-existing entries.

avatar

Odd, what version of RDM are you using?

Here is the Clean Up Activity Logs SQL statement with All vaults & all user vaults & Include Administration Logs checked. You will notice that we don't reference the dbo.Connection table. Yes, we reference dbo.Repository but using a LEFT OUTER join so the impact is null since we the options above we don't filter on the table.

Note: I added a BEGIN TRAN & ROLLBACK TRAN so the statement won't commit the delete so you can run it to test to see how many rows get deleted (adjust the date accordingly).

BEGIN TRAN

DECLARE @Date datetime;
SET @Date='2022-12-10 23:59:59.997';

DELETE cl
FROM dbo.ConnectionLog cl
    LEFT OUTER JOIN dbo.Repository r on cl.RepositoryID = r.ID
WHERE (cl.CreationDate <= @Date);

ROLLBACK TRAN

Stéfane Lavergne