Moving the SQL Storage Compress index, key and log files
Published 06 February 2015
Moving the index files
If you are experiencing problems with the performance of SQL Storage Compress, you may find it helpful to store the indexes for the compressed database files on a different physical disk to the system files and compressed database files (*.mdfx,*.ndfx, *.ldfx, *.mdfe, *.ndfe and *.ldfe).
By default, the index files are stored in %ProgramFiles(x86)%\Red Gate\HyperBac\indexes on 64-bit machines and%ProgramFiles%\Red Gate\HyperBac\indexes on 32-bit machines. Note that if you are also using SQL Virtual Restore, the indexes for virtually restored databases are also stored in this folder and will be moved as part of this process.
To change the location of the index files:
- If you are also using SQL HyperBac, ensure that no SQL HyperBac backups are in progress.
- Take any SQL Storage Compress or SQL Virtual Restore databases offline:
- Right-click each database in SQL Server Management Studio (SSMS), and select Tasks > Take Offline. You may need to run this task twice before SSMS reports the database as being offline.
or
Make sure you are connected to the master database, then run the following T-SQL statement for each database:
ALTER DATABASE <database name> SET OFFLINE
You may need to run this statement twice before SQL Server reports the database as being offline.
Alternatively, stop the SQL Server instance. To do this, right click the instance in SQL Server Management Studio and clickPause followed by Stop, or stop the service in the Windows Services list.
- Right-click each database in SQL Server Management Studio (SSMS), and select Tasks > Take Offline. You may need to run this task twice before SSMS reports the database as being offline.
- From the system tray, double-click the HyperBac Configuration Manager icon to open the HyperBac Configuration Manager.
- On the General tab, click the stop button to Stop the HyperBac Control Service.
- On the Advanced tab, click the browse button next to the Index Path and select a location on a different physical disk.
- Click Save.
- Move the indexes folder and all of its contents to the new disk location you have specified.
- Return to the HyperBac Configuration Manager. On the General tab click the Start button to restart the HyperBac Control Service.
- Click Exit to close the HyperBac Configuration Manager.
Bring any SQL Storage Compress or SQL Virtual Restore databases back online. You can do this using the Bring online task in SQL Server Management Studio or by running the following T-SQL statement against the master database for each compressed database:
ALTER DATABASE <database name> SET ONLINE
Key and log files
You can use the process for moving index files described above to move the key files and log files. Substitute Index Path in step 5 with Encryption Key Path or Log Path, and indexes folder in step 7 with keys folder or logs folder as appropriate. Note that these files are also used by SQL Virtual Restore and SQL HyperBac, and any changes you make will also be applied to these programs.
Key files
The key files are used by SQL Storage Compress to encrypt and decrypt data and log files, and by SQL Storage Compress, SQL Virtual Restore and SQL HyperBac to encrypt and decrypt backup files. By default the key files are stored in%ProgramFiles(x86)%\Red Gate\HyperBac\keys on 64-bit machines and %ProgramFiles%\Red Gate\HyperBac\keys on 32-bit machines.
Log files
The log files are written by the HyperBac Control Service whenever SQL Storage Compress, SQL Virtual Restore or SQL HyperBac is in use, and include information about service startup and shutdown and operations performed by the service. By default the log files are stored in %ProgramFiles(x86)%\Red Gate\HyperBac\logs on 64-bit machines and%ProgramFiles%\Red Gate\HyperBac\logs on 32-bit machines.