Stored Procedure to shrink SCSPDB database partitions
search cancel

Stored Procedure to shrink SCSPDB database partitions

book

Article ID: 252743

calendar_today

Updated On:

Products

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

Issue/Introduction

With the release of DCS 6.9.2, a store procedure allowing shrinking of partitioned databases was released. This makes this task a lot smoother and easier to run. This stored procedure can be run on older DCS 6.9.x versions that have partitioning enabled on the database, so long as its added manually from a newer install.

Environment

Data Center Security 
Version 6.9.2 and higher

Resolution

Executing the SCSPDB Shrink partitions:

  1. This store procedure is located under the SCSPDB database> Programmability> Stored Procedures> dbo.SCSP_ShrinkDbPartitions

     2. To execute this query, right click> Execute. This will prompt a new window to input some variables:

     3. Each value is as follows:

    1. @eventClass: the type of group events. There are 3 types, real time, analysis, profile. The variables are: "REALTIME", "PROFILE", "ANALYSIS"
    2. @dataFileShrink : this is the size in MB for the shrinking process.
    3. @shrinkMode: 2 options here, either "TESTMODE", "SHRINK". This will allow to either run a test to see how the process will run and how long it will take as well as what will be affected, or to execute this in the environment.

     4. Once the query is ran as a TESTMODE, the outpu will look like this:

Once ready to execute this query, change the value from TESTMODE to SHRINK if the results are to your satisfaction.

 

Attachments

1666582855188__SCSP_ShrinkDbPartitions.sql get_app