Table of Contents
BACKUP DATABASE
The BACKUP DATABASE statement is used to create a backup of a database. This command works for both local and Server-based databases.
Syntax
BACKUP DATABASE [TO absolute_path] [WITH DIAGNOSE]
Arguments
[TO absolute_path]
specifies the absolute path to folder where backup should be produced. If it is not specified then backup will be produced in the same folder where the database is located.Valentina creates the backup at the specified location the directory “Backup”. If this directory does not exist, then it creates the backup inside a folder named after the timestamp that contains files of backup database. Each backup produces one more folder with a timestamp name.
Under Valentina Server the absolute path will be silently ignored and replaced with SystemBackupCatalog (see vServer INI).
[WITH DIAGNOSE]
if specified then before backup will be executed diagnose database.If diagnose fails then backup is not produced and error is returned. If this command is used in the shedule of Valentina Server then error go into log file.
Notes
- This command has the most sense to be used with CREATE EVENT command of Valentina Server.
- Backup can be used for Valentina Server without stopping the server. It locks the database, flushes the cache, then copy disk files of database. This operation is as fast as SizeOfDatabase (Mb) / Speed of HDD read/write (MB). Users are not disconnected during a hot backup but any calls are delayed until the backup completes.
* If your computer have another HDD and you have specify TO absolute_path point on this second HDD, then you can double speed of backup
* Valentina Server can send an email upon completion of a hot backup using the CREATE EVENT command as above; See Generating And Sending Reports By an Email On a Schedule (Any Datasource).
Examples
Example
BACKUP DATABASE WITH DIAGNOSE