HyperUtil.exe

HyperUtil.exe is a free command line utility included with SQL Storage Compress.

You can use HyperUtil.exe with SQL Storage Compress compressed database files (*.mdfx*.ndfx and *.ldfx) or encrypted database files (*.mdfe*.ndfe and *.ldfe) to:

  • view information about a file
  • verify the integrity of a file's contents
  • convert a compressed or encrypted file to native SQL Server format
  • defragment a compressed or encrypted file

You can also use HyperUtil.exe to convert SQL HyperBac files to native SQL Server backup format. This can be useful when restoring a SQL Storage Compress database from a SQL HyperBac backup that was encrypted on a different server.

For more information, see Working with key files for encrypted data.

You do not need a SQL Storage Compress license to use HyperUtil.exe.

HyperUtil.exe syntax

Argument

Description

/S[ource]"filepath"

Specify the location and name of the file you want to use. Required for all operations.

/O[utput]"filepath"

Specify the location and name for the native SQL Server file that HyperUtil.exe will generate.

Required for Extract (/E).

/K[ey]"filepath"

Specify the location and name of the key file used to encrypt the source file.

Required if the source file is encrypted.

See Working with key files for encrypted data for more information about how SQL Storage Compress uses key files.

/Q[uery]

Display information about the source file.

/T[est]

Verify the integrity of the source file's contents.

/E[xtract]

Create a native SQL Server version of the source file with the location and name specified by /O.

/D[efrag]

Defragment the source file (specified by /S). Defragmentation can reduce the size of the source file by recovering free space. Use /F to control the amount of free space left in the file after defragmentation.

/F[ill factor]fill factor percentage

Specify the fill factor of the source file when using /D.

Fill factor determines how much space is allocated to data and ranges from 60 to 100 percent. The default setting is 90 percent.

Note: Using 100 percent is not recommended, as no free space is left in the file, which may cause it to become fragmented more quickly.

/I[gnore]

Ignore errors during defragmentation.

/V[erbose_output]

Display detailed information about the operation.

/Y[do_not_prompt_for_overwrite]

Silently overwrite an existing output file.

/? or --help

Display help information.

Using HyperUtil.exe

  1. Identify the database that the file belongs to and take it offline. To do this, either:
    • Right-click the 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 the database:
    ALTER DATABASE <database name> SET OFFLINE

    You may need to run this statement twice before SQL Server reports the database as being offline.

  2. Open a Command Prompt window in the HyperBac bin folder (hold SHIFT, right-click and select Open command window here). By default, HyperUtil.exe is copied to %ProgramFiles%\Red Gate\HyperBac\bin on 32-bit machines and%ProgramFiles(x86)%\Red Gate\HyperBac\bin on 64-bit machines when the HyperBac Compression Engine Components are installed.
    Alternatively, open a Command Prompt window anywhere and change directory to the HyperBac bin folder (for example,cd C:\Program Files\Red Gate\HyperBac\bin).
  3. Type the required command, and press RETURN to execute it. See the examples below for more information.

Examples

Display information about a SQL Storage Compress database file

The following command lists information about the SQL Storage Compress compressed data file,AdventureWorks_Data_SSC.mdfx:

HyperUtil.exe /S"C:\Data\AdventureWorks_Data_SSC.mdfx" /Q

Verify a SQL Storage Compress database file

The following command verifies the contents of the SQL Storage Compress compressed data file,AdventureWorks_Data_SSC.mdfx:

HyperUtil.exe /S"C:\Data\AdventureWorks_Data_SSC.mdfx" /T

Convert a SQL Storage Compress compressed database file to native SQL Server format

The following command converts the SQL Storage Compress compressed data file AdventureWorks_Data_SSC.mdfx to an uncompressed, native SQL Server file AdventureWorks_Data_uncompressed.mdf:

HyperUtil.exe /S"C:\Data\AdventureWorks_Data_SSC.mdfx" /O"C:\Data\AdventureWorks_Data_uncompressed.mdf" /E

For more information about converting a compressed database to native SQL Server format, see Converting compressed databases to native format.

Convert a SQL Storage Compress encrypted database file to native SQL Server format

The following command converts the SQL Storage Compress encrypted and compressed data fileAdventureWorks_Data_SSC.mdfe to an unencrypted, uncompressed, native SQL Server fileAdventureWorks_Data_unencrypted.mdf:

HyperUtil.exe /S"C:\Data\AdventureWorks_Data_SSE.mdfe" /O"C:\Data\AdventureWorks_Data_unencrypted.mdf" /K"C:\Program Files\Red Gate\HyperBac\keys\AES_256.key" /E

For more information about converting an encrypted database to native SQL Server format, see Converting compressed databases to native format.

Defragment a SQL Storage Compress database file

The following command defragments the SQL Storage Compress compressed data file AdventureWorks_Data_SSC.mdfxusing a fill factor of 75 percent.

HyperUtil.exe /S"C:\Data\AdventureWorks_Data_SSC.mdfx" /D /F75

Convert an encrypted SQL HyperBac backup to native SQL Server format

The following command converts the SQL HyperBac encrypted backup AdventureWorks.hbe to an unencrypted, native SQL Server backup AdventureWorks.bak:

HyperUtil.exe /S"C:\Backups\AdventureWorks.hbe" /O"C:\Backups\AdventureWorks.bak" /K"C:\Program Files\Red Gate\HyperBac\keys\AES_256.key" /E

These operations do not delete or overwrite the source file.


Didn't find what you were looking for?