LucidDbSysRoot RESTORE DATABASE
From Eigenpedia
Contents |
Syntax
CALL SYS_ROOT.RESTORE_DATABASE( archive_path ); CALL SYS_ROOT.RESTORE_DATABASE_WITHOUT_CATALOG( archive_path);
Purpose
Restores LucidDB from a previously created system backup. See LucidDbBackupRestore for an overview of backup and restore in LucidDB.
The first syntax variation restores both the data pages and catalog metadata, while the second only restores the data pages. When only data pages are restored, the data is inaccessible until the catalog data is restored. Therefore, although you can restart and connect to LucidDB after restoring only the data, you cannot select from any tables, execute DML statements, or create/drop tables.
Parameters
- archive_path: [VARCHAR(65535)] the pathname of the directory containing the backup files that will be restored
Examples
Assume the following backups were created:
- Monday - full backup in /home/system/fullArchive
- Tuesday - incremental backup in /home/system/incrArchive
- Wednesday - differential backup in /home/system/diffArchive
If on Thursday, you decide that you want to restore the system back to its state as of Tuesday, you would execute the following in sequence. Note that:
- No other users can be using the system while the executing the restore. (The best way to ensure this is to use sqllineEngine rather than lucidDbServer+sqllineClient for the restore execution.)
- LucidDB must be restarted after executing each restore call. (Note eigenjira:LDB-190 if you are using lucidDbServer instead of sqllineEngine.)
- No SQL statements can be executed in between each restore call.
- Restarting LucidDB after each restore call may take some time as the catalog gets reloaded at that point.
- You only need to restore the catalog data in the last restore command in a sequence. Hence, that's why the full archive is invoked using the
RESTORE_DATABASE_WITHOUT_CATALOGUDR.
CALL SYS_ROOT.RESTORE_DATABASE_WITHOUT_CATALOG('/home/system/fullArchive');
CALL SYS_ROOT.RESTORE_DATABASE('/home/system/incrArchive');
If instead, you want to restore the system as of its state on Wednesday, you would execute the following in sequence, again, with the same restrictions noted above:
CALL SYS_ROOT.RESTORE_DATABASE_WITHOUT_CATALOG('/home/system/fullArchive');
CALL SYS_ROOT.RESTORE_DATABASE('/home/system/diffArchive');

