mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Fix sample to work on SLES. . The issue is in access to the shared memory that VDI uses to communicate between SQL Server and the client application. When opening the file, the mode is modified by the current umask setting and group sharing is removed.
SQLVDI for Linux
This folder contains the latest files and samples required to build a SQL Server VDI based backup/restore application for Linux.
Files available
- vdi.h
- vdierror.h
- vdipipesample.cpp
- MAKEFILE
Known Bugs
There is a problem with VDF_LikeDisk and VDF_RandomAccess where the backup/restore is aborted unexpectedly.
Steps
-
Install the mssql-server and mssql-tools packages
Install SQL Server on Linux Install SQL Server tools on Linux
-
Install the clang and uuid-dev packages in order to build the sample.
Example (for Ubuntu):
sudo apt-get install clang sudo apt-get install uuid-dev -
Create a symbolic link to sqlcmd in /usr/bin
sudo ln -s /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd -
Copy the vdi sample files to a directory on your Linux machine.
-
Run make to build the sample code
-
Run the vdi client as the mssql user or follow these instructions:
- Add the user running the vdi client to mssql group
sudo usermod -a -G mssql vdiuser. - Add the mssql user to the vdi client user's group
sudo usermod -a -G vdiuser mssql. - Reboot
- Add the user running the vdi client to mssql group
-
Run the following command to issue a database backup of pubs:
LD_LIBRARY_PATH="/opt/mssql/lib" ./vdipipesample B D pubs sa <SQLSAPASSWORD> /tmp/pubs.bak