DbDefence Installation on Linux

Important: You can only install DbDefence to local SQL instances. DbDefence can't be installed remotely!

If you need DbDefence on several instances, run the installer severl times for each instance.

DbDefence will initially be installed as a free version, but after activation with a valid activation key, the installation will switch to the full, unlimited version.

The Free Version can be used in commercial projects. However, the Free Version has a limited database size of up to 30 Mb. You can read more about obtaining the full version.

Permissions

The installer requires root access to /opt/mssql/ directory. There are no system modules or services installed on Linux. The installer changes only MS SQL Server bin directory. Before the installation it makes a backup of important system files.

Installation

The installation consists of four simple steps.

1. Stopping SQL Server instance

sudo service mssql-server stop

2. Installing files

Copy dbdefence_linux_installer.exe to any folder on a server. It has extension .exe, but it is designed to run on Linux. Set execute permissions and execute:

chmod +x dbdefence_linux_installer.exe
sudo dbdefence_linux_installer.exe -install /opt/mssql/

3. Starting SQL Server

sudo service mssql-server start

4. Running SQL script

A special installation script creates a set of procedures in the master database required for DbDefence. You can see the script by executing:

./dbdefence_linux_installer.exe -script

If you have mssql-tools package installed, the script can be run immediately:

./dbdefence_linux_installer.exe -script | /opt/mssql-tools/bin/sqlcmd -S . -U sa -P "SA_PaSSword"

Typical output would be something like this:

If you don't have mssql-tools installed you can redirect the output to a file and then run it from your favorite query tool.

./dbdefence_linux_installer.exe -script > query.sql

Execute query.sql and installation is complete.

Uninstallation

Before the uninstallation you need to decrypt all encrypted databases manually. Encrypted databases will stop working without DbDefence. See Database Decryption for more info.

1. Removing stored procedures

A special uninstall script removes DbDefence procedures in the master database. You can see the script by executing:

./dbdefence_linux_installer.exe -unscript

If you have mssql-tools package installed, you can run the script immediately:

./dbdefence_linux_installer.exe -unscript | /opt/mssql-tools/bin/sqlcmd -S . -U sa -P "SA_PaSSword"

Typical output would be something like this:

If you don't have mssql-tools installed you can redirect the output to a file and then run it from your favorite query tool.

./dbdefence_linux_installer.exe -unscript > query.sql

Execute query.sql manually.

2. Stopping SQL Server instance

sudo service mssql-server stop

3. Removing files

To remove DbDefence files execute:

sudo dbdefence_linux_installer.exe -uninstall /opt/mssql/

4. Starting SQL Server

Uninstallation is complete. The instance can be started:

sudo service mssql-server start