Restore Strategy and Procedure

You must consider the followings before restoring databases.

Database Restore Procedure

The following procedure shows how to perform backup and restoration described in the order of time.

  1. Performs a full backup of demodb which stopped running at 2008/8/14 04:30.
  2. Performs the first incremental backup of demodb running at 2008/8/14 10:00.
  3. Performs the first incremental backup of demodb running at 2008/8/14 15:00. Overwrites the first incremental backup file in step 2.
  4. A system failure occurs at 2008/8/14 15:30, and the system administrator prepares the restore of demodb. Sets the restore time as 15:25, which is the time when the last commit was made before database failure
  5. The system administrator prepares the full backup file created in Step 1 and the first incremental backup file created in Step 3, restores the demodb database up to the point of 15:00, and then prepares the active and archive logs to restore the database up to the point of 15:25.

Time

Command

Description

2008/8/14 04:25

cubrid server stop demodb

Shuts down demodb.

2008/8/14 04:30

cubrid backupdb -S -D /home/backup -l 0
demodb

Performs a full backup of demodb in offline mode and creates backup files in the specified directory.

2008/8/14 05:00

cubrid server start demodb

Starts demodb.

2008/8/14 10:00

cubrid backupdb -C -D /home/backup -l 1
demodb

Performs the first incremental backup of demodb online and creates backup files in the specified directory.

2008/8/14 15:00

cubrid backupdb -C -D /home/backup -l 1
demodb

Performs the first incremental backup of demodb online and creates backup files in the specified directory. Overwrites the first incremental backup file created at 10:00.

2008/8/14 15:30

 

A system failure occurs.

2008/8/14 15:40

cubrid restoredb -l 1 -d 08/14/2008:15:25:00
demodb

Restores demodb based on the full backup file, first incremental backup file, active logs and archive logs. The database is restored to the point of 15:25 by the full and first incremental backup files, the active and archive logs.