This topic describes how to initiate a data backup after you initiate a log backup.
Prerequisites
Before you initiate a data backup, make sure that the following conditions are met:
A log backup has been initiated. You can initiate a data backup only when the STATUS of the log backup is DOING.
For more information, see Initiate a log backup.
Initiate a full data backup
Log on to the
systenant as therootuser.(Optional) Execute the following statement to set a backup password:
Note
This password is the password of the backup set after the backup task is completed. When this parameter is set, you must enter this password to restore data by using this backup set. This password cannot be deleted.
obclient> SET ENCRYPTION ON IDENTIFIED BY 'password' ONLY;Here is an example:
obclient> SET ENCRYPTION ON IDENTIFIED BY '******' ONLY;Note
After you set a backup password, you can disconnect the session and reconnect to the database to cancel the setting before a data backup is initiated.
Execute the following statement to initiate a full backup:
obclient> ALTER SYSTEM BACKUP DATABASE;During the backup, you can execute the following statements to view the status and details of the backup task:
View the ongoing backup task.
For more information about fields in CDB_OB_BACKUP_PROGRESS, see CDB_OB_BACKUP_PROGRESS.
obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_PROGRESS;View the history of backup tasks.
obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_SET_FILES;For more information about fields in
CDB_OB_BACKUP_SET_FILES, see CDB_OB_BACKUP_SET_FILES.
Initiate an incremental data backup
An incremental data backup backs up all macroblocks modified since the last full backup. We recommend that you verify that full backup has been performed before you perform an incremental backup.
Note
By default, an incremental backup uses the parameter settings of the last full backup or incremental backup.
Log on to the
systenant as therootuser.Execute the following statement to start an incremental backup task:
obclient> ALTER SYSTEM BACKUP INCREMENTAL DATABASE;You can view the progress of the incremental backup task in the CDB_OB_BACKUP_PROGRESS view.