Blue Mountain RAM Database: How to Optimize

Furthering our knowledge of the Blue Mountain RAM Database, from the reasons for database growth to the optimization of general performance and facilitation of performance analysis, this second blog in our ‘Optimizing Blue Mountain RAM Database’ series will cover the necessary steps needed to optimize your database. Let’s begin by reviewing the maintenance procedures needed to minimize file size and growth.

Steps To Optimize Your Database:

  1. Perform a Full Database backup.
  2. Execute the DBCC OPENTRAN command. This will check for potential open transactions. There should not be any open transactions existing before proceeding.
  3. Temporarily switch the Recovery Model to BULK_LOGGED. This allows script to run more efficiently.
  4. Temporarily increase the size and growth values of the data. Log files by doubling their current values to allow the following script to run more efficiently.
  5. Execute the “BatchTransactionLogTruncation.sql” script. This allows you to perform the metrics calculation and truncation operation. Note that this script may take hours to complete.
  6. Temporarily switch the Recovery Model to SIMPLE. This will allow the subsequent shrink database operation to successfully shrink both the data and log files.
  7. Execute the DBCC SHRINKDATABASE command on the database.
  8. Execute the “AdjustIndexes.sql” script. This rebuilds all indexes which have now been fragmented by the shrink database operation.
  9. Set the size and growth values of both the data and log files to appropriate values.
  10. Switch the Recovery Model back to the original value (FULL or SIMPLE).
  11. Create a scheduled SQL Job to execute the existing stored procedure in the database. This will perform the metrics calculation and truncation operation on a monthly basis.

Following the procedures described above ensures the optimization of your database. The best part of this process is that the steps only need to be performed once. By optimizing your Blue Mountain RAM database, you will see many benefits. Such include available transaction metrics for performance analysis, accessible defragmented and optimized database files (.mdf/.ldf), minimized data and backup file sizes, improved backup and restore operations performance, and enhanced general system performance.

If you would like to execute this process, contact your Technical Support team at for the necessary documentation and scripts.


Leave a Reply