Go to ...

Techpository

A Better Technical Repository

RSS Feed

Citrix: Reducing the RMSummaryDatabase Size


Once you’ve backed up the RM summary Database, you can run a manual purge on the prod database to get rid of what was backed up. Here’s the query (to be run from Query Analyzer):

**********

**********************************
DECLARE @farmName nvarchar(255)
DECLARE @sCutoffDate datetime
SELECT @farmName = N’EnterYourFarmName’
SELECT @sCutoffDate = ‘2007-03-05 16:20:00′ <= Enter the relevant date.
EXEC PurgeUnbilledSessProc @farmName, @sCutoffDate
EXEC Purgeevents @farmName, @sCutoffDate
EXEC Purgemetrics @farmName, @sCutoffDate
********************************************Note: If your customer is using billing, you will need to add this line as well:

********************************************
EXEC PurgeBilledSessProc @farmName, @sCutoffDate
********************************************

Note2: Is your customer using web interface? If so, you might want to get rid of randomly generated client name from the LU_CLIENT table that will not be used anymore:

********************************************
Delete FROM LU_client WHERE PK_clientID NOT IN ( SELECT FK_clientID FROM SDB_session )
and PK_clientID NOT IN ( SELECT FK_clientID FROM SDB_process )
and PK_clientID NOT IN ( SELECT FK_clientID FROM SDB_clienthistory )
********************************************

Note3: Same thing for the LU_USER table:

********************************************
Delete FROM LU_USER WHERE PK_userID NOT IN ( SELECT FK_userid FROM SDB_process )
and PK_userID NOT IN ( SELECT FK_userid FROM SDB_session )
********************************************
There are many ways to reduce the size of the RMDB but it all depends on what is expected from it so, unless the storage for backup is not an issue, you might need to understand what it is used for (billing, report types, etc).

By Vincent