The following xSQL commands are provided to perform incremental backup and restore operations on in-memory and persistent databases. (Also note that file backup can be performed for persistent databases by calling SQL function
Note: backup_map_size should be defined in
db_paramsand set to a power of two.
BACKUPXSQL>backup [TO] file_name [FULL|INCREMENTAL|AUTO] [[AS] label] [WITH CIPHER=key [',' COMPRESSION=level ]];
file_nameargument is required; the other parameters are optional.
Note that it is quite possible to perform a continuous backup in a loop. For example, using bash:!/bin/bash While true; do xsql ... "BACKUP ..." done
RESTORE a backup
restorecommand is used to restore the current database from a given backup file. If it is necessary to restore a database from several consecutive backups, it has to be done by calling the
restoreseveral times in the chronological order:XSQL>restore [FROM] file_name [[TO] label] [WITH CIPHER=key];
List the backup contents
To list the content of a backup file use the SQL function
backup <backup-file>to print out the backup labels and some generic backup information to the console:XSQL>select * from backup <backup-file>;