How can I shrink the CASRMCentralDB database in SQL Server used with Web Reporter?
search cancel

How can I shrink the CASRMCentralDB database in SQL Server used with Web Reporter?

book

Article ID: 52973

calendar_today

Updated On:

Products

STORAGE RESOURCE MANAGEMENT SUITE

Issue/Introduction

Description:

When you perform the Add AS/Delete AS/Modify AS operations using the Web Reporter Control Panel UI, both the .mdf & .ldf files size increase, and in case of .ldf file, it grows drastically since you perform bulk operations like Add AS/Delete AS at a single go.

Environment

Release: BRMAPS20100-11.7-Storage Resource Manager-Application Server
Component:

Resolution

To shrink the size of the database Before implementing below solutions please refer to the following Microsoft KBASE article:  Considerations for the autogrow and autoshrink settings in SQL Server

  1. Database level: You can perform the following two options by enabling shrinking option as provided by MS SQL Server by executing the below commands.

    • Option # 1: ALTER DATABASE [CASRMCentralDB] SET AUTO_SHRINK ON By enabling this option the database engine periodically examines the space usage in each database and reduces the size of the files in the database. This activity occurs in the background and does not affect any user activity within the database.

    • Option # 2: DBCC SHRINKDATABASE ([CASRMCentralDB], 10, TRUNCATEONLY) This option enables manual shrink of database or files. Pros:

      • The SQL Server takes care of automatic shrinking.

      Cons:

      • Disk fragmentations issues may creep up due to which, in long run there might be chances of corrupting the operating system.

      • Due to the fragmentation SQL Server performance might slow down.

  2. File Level: You can manually execute the below SQL commands in frequent time intervals: BACKUP LOG [CASRMCentralDB] WITH TRUNCATE_ONLY Cons:

    • The administrator has to track and check the log size, and perform this activity from time to time.

  3. Truncating: When you perform regular SQL Server back-ups, enable truncate log option so that the backup software will truncate the logs after it is backed up. Pros:

    • This is a very common practice in every application