Backup policies are best implemented sooner rather than later. Scimore includes two specific SQL commands, BACKUP and RESTORE, for backing up and restoring tables, databases and clusters.
In a multi-machine distributed cluster, it is important to keep track of which server you are backing up the data on. As Scimore does not have any data redundancy, it is probably a good idea to backup on more than one machine in a distributed cluster. The path used for backups can be a Windows share on a seperate machine to where the instance is installed.
Currently, there is only one format used for backups and restores. A "SHARE" directory is given to BACKUP and RESTORE. Within this, a directory for each database is created. Within the database directory, a schema.sql file is generated and a table_name.bin for each table backed up.
Eg. If the database "testdb1" contained the tables "table1" and "table2", the command
BACKUP DATABASE testdb1 TO SHARE 'C:/backups/scimore' INSTANCE 0
would create the following files on the machine that server instance 0 was running.
C:\backups\scimore\testdb1 C:\backups\scimore\testdb1\table1.bin C:\backups\scimore\testdb1\table2.bin C:\backups\scimore\testdb1\schema.sql
It is possible to use the backslash '\' character, but remember to escape it, thus
BACKUP DATABASE testdb1 TO SHARE 'C:\\backups\\scimore'
It is also possible to backup to a Windows network share using the usual syntax:
BACKUP DATABASE testdb1 TO SHARE '//somecomputer/backupshare' INSTANCE 0
This will use the shared folder named "backupshare" on the host "somecomputer", as recognised by server instance 0.
The RESTORE command uses a complementary syntax to BACKUP to restore the data. It will locate the schema.sql file and execute the script. This defines the tables and loads the data.
Related