ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

DCS Events/Data on the database volume are growing causing low disk space


Article ID: 240362


Updated On:


Data Center Security Server Advanced Data Center Security Server Data Center Security Monitoring Edition


DCS data retention in the DB server. We notice the DB file is growing exponentially with no sign of deleting aged data (e.g. events are configured to purged), and this in return causes an increase in the disk space utilized by the DB.



SQL DB partitions need to be shrunk as by default they are only used for 1 day's worth of data and recycled every 2 years.


Data Center Security

Release : 6.9.1, 6.9.2


A new feature has been added to DCS 6.9.2 that allows you to shrink only empty partitions in the database.

CS 6.9.2 Database Partition Shrink procedure with resize options

Where is the stored procedure?
The stored procedure is compiled into SQL Server and stored in the DB during the upgrade (or fresh install)

What commands do I use to run this procedure?
Test Mode
/* Running procedure in TEST mode to determine how much space would be released*/
EXEC SCSP_ShrinkDbPartitions @eventClass='REALTIME', @dataFileShrinkTargetSizeInMB=50, @shrinkMode='TESTMODE'; 
EXEC SCSP_ShrinkDbPartitions @eventClass='PROFILE',  @dataFileShrinkTargetSizeInMB=10, @shrinkMode='TESTMODE';
EXEC SCSP_ShrinkDbPartitions @eventClass='ANALYSIS',  @dataFileShrinkTargetSizeInMB=10, @shrinkMode='TESTMODE';

Purge Mode
/* Running procedure to actually SHRINK only those empty partitions not in use*/
EXEC SCSP_ShrinkDbPartitions @eventClass='REALTIME', @dataFileShrinkTargetSizeInMB=50, @shrinkMode='SHRINK';
EXEC SCSP_ShrinkDbPartitions @eventClass='PROFILE',  @dataFileShrinkTargetSizeInMB=10, @shrinkMode='SHRINK';
EXEC SCSP_ShrinkDbPartitions @eventClass='ANALYSIS',  @dataFileShrinkTargetSizeInMB=10, @shrinkMode='SHRINK';

How often should we run the stored procedure
We recommend you run this at least monthly and no more then weekly.