How to make a backup of the database from terminal?

1

I have a database in MS SQL Server 2017 express, in ubuntu 16.04, I am administering it DBeaver and I do not set an option to make a backup, I have tried with terminal and it does not work: $ tsql -S localhost -U SA

BACKUP DATABASE prolo TO DISK = '/ home / user / bakup' go but it does not work says there is a syntax error.

    
asked by Igmer Rodriguez 10.03.2018 в 06:42
source

1 answer

2

It seems that you need to specify the extension to the name of the backup file in the BACKUP DATABASE command:

BACKUP DATABASE prolo TO DISK = '/home/user/bakup.bak'

Additionally it is likely that you will have to specify additional options to specify that you do not compress the backup since the express version does not support compression, for example:

BACKUP DATABASE [base] TO  DISK = N'/var/opt/mssql/data/file.bak' 
WITH NOFORMAT, NOINIT,  NAME = N'TSQLV4-Full Database Backup',
 SKIP, NOREWIND, NOUNLOAD, NO_COMPRESSION,  STATS = 10;
GO

    
answered by 12.03.2018 в 23:15