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.
To shrink the size of the database Before implementing below solutions please refer to the following Microsoft KBASE article: http://support.microsoft.com/kb/315512
- 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.
- 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.
- 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.
- 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