As the core component to ensure the high availability of OceanBase Database, the backup and restore module protects data security by preventing misoperations and damages to the storage media. If data is lost due to misoperations or damage to the storage media, you can restore the data.
OceanBase Database supports the backup, restore, and purging of data in two types of storage media: Object Storage Service (OSS) and Network File System (NFS).
OceanBase Database supports tenant-level physical backup. Physical backup data includes backup data and log archive data. Therefore, physical backup consists of log archiving and data backup.
Data backup refers to the backup of data, and includes full backup and incremental backup:
Full backup refers to the backup of all macroblocks.
Incremental backup refers to the backup of macroblocks that are added or modified since the last backup.
Directories at the backup destination and file types under each directory:
/data_backup_dest/ # The user-defined data backup path.
├── format // The format information.
├── check_file
│ └── 1002_connect_file_20220601T010101 // The connectivity check file, suffixed with date and time in the format of YYYYMMDDTHHMMSS.
├── backup_sets // The backup_set placeholder for the list.
│ ├── backup_set_1_full_start // The start placeholder for a full backup.
│ ├── backup_set_1_full_end_success_20220602T0200510 // The end placeholder for a full backup.
│ ├── backup_set_2_inc_start // The start placeholder for an incremental backup.
│ └── backup_set_2_inc_end_success_20220609T021001 // The end placeholder for an incremental backup.
├── backup_set_1_full
│ ├── backup_set_1_full_20220602T010000_20220602T0200510 //The placeholder that represents the start and end time of the backup.
│ ├── single_backup_set_info //The metadata of the current backup_set.
│ ├── tenant_backup_set_infos /The full backup_set information of the current tenant.
│ ├── infos
│ │ ├── data_info_turn_1 // The tenant backup files under turn 1.
│ │ │ ├── tablet_log_stream_info // The file describing the mapping between tablets and log streams.
│ │ │ ├── tenant_major_data_macro_range_index // The major macroblock index.
│ │ │ ├── tenant_major_data_meta_index // The major meta index.
│ │ │ ├── tenant_major_data_sec_meta_index // The mapping between the major logic ID and the physical ID.
│ │ │ ├── tenant_minor_data_macro_range_index // The minor macroblock index.
│ │ │ ├── tenant_minor_data_meta_index // The minor meta index.
│ │ │ └── tenant_minor_data_sec_meta_index // The mapping between the minor logic ID and the physical ID.
│ │ ├── diagnose_info // The diagnosis information file of the backup_set.
│ │ ├── locality_info // The tenant locality information of the current backup_set.
│ │ └── meta_info // The tenant-level log stream metadata file, which contains the metadata of all log streams.
│ │ ├── ls_attr_info_turn_1
│ │ └── ls_meta_infos
│ ├── logstream_1 // Log stream 1
│ │ ├── major_data_turn_1_retry_0 // The baseline data under turn 1, retry 0.
│ │ │ ├── macro_block_data.0 // A data file sized between 512 MB and 4 GB.
│ │ │ ├── macro_range_index // The macro index.
│ │ │ ├── meta_index // The meta index.
│ │ │ └── sec_meta_index // The file describing the mapping between the logical ID and the physical ID.
│ │ ├── meta_info_turn_1_retry_0 // The log stream metadata file under turn 1, retry 0.
│ │ │ ├── ls_meta_info // The log stream metadata.
│ │ │ └── tablet_info // The list of log stream tablets.
│ │ ├── minor_data_turn_1_retry_0 // The minor-compacted data under turn 1, retry 0.
│ │ │ ├── macro_block_data.0
│ │ │ ├── macro_range_index
│ │ │ ├── meta_index
│ │ │ └── sec_meta_index
│ │ └── sys_data_turn_1_retry_0 // The system tablet data under turn 1, retry 0.
│ │ ├── macro_block_data.0
│ │ ├── macro_range_index
│ │ ├── meta_index
│ │ └── sec_meta_index
│ └── logstream_1001
│ ├── major_data_turn_1_retry_0
│ │ ├── macro_block_data.0
│ │ ├── macro_range_index
│ │ ├── meta_index
│ │ └── sec_meta_index
│ ├── meta_info_turn_1_retry_0
│ │ ├── ls_meta_info
│ │ └── tablet_info
│ ├── minor_data_turn_1_retry_0
│ │ ├── macro_block_data.0
│ │ ├── macro_range_index
│ │ ├── meta_index
│ │ └── sec_meta_index
│ └── sys_data_turn_1_retry_0
│ ├── macro_block_data.0
│ ├── macro_range_index
│ ├── meta_index
│ └── sec_meta_index
├── backup_set_2_inc // The incremental backup directory, which is consistent with the full backup directory.
Log archiving refers to the automatic backup of log data. OBServer nodes regularly archive log data to the specified backup path without manual triggering.
Directories at the backup destination and file types under each directory:
/log_archive_dest/ # The user-defined root directory for archiving log files.
├── format # The format information.
├── check_file
│ └── 1002_connect_file_20220601T010101 // The connectivity check file, suffixed with date and time in the format of YYYYMMDDTHHMMSS.
├── rounds # The rounds placeholder directory.
| ├── round_d1001r1_start # The round start placeholder.
| ├── round_d1001r1_end # The round end placeholder.
| ├── round_d1001r2_end # The round end placeholder.
├── pieces # The piece placeholder directory.
| ├── piece_d1001r1p1_start_20220601T010101 # The piece start placeholder, in the format of piece_DSETID_ROUND_ID_PIECEID_DATE_start.
| ├── piece_d1001r1p1_end_20220602T010101 # The piece end placeholder, in the format of piece_DSETID_ROUND_ID_PIECEID_DATE_end.
| ├── piece_d1001r1p2_start_20220602T010101 # The piece start placeholder, in the format of piece_DSETID_ROUND_ID_PIECEID_DATE_start.
| ├── piece_d1001r1p2_end_20220602T120000 # The piece start placeholder, in the format of piece_DSETID_ROUND_ID_PIECEID_DATE_start.
| ├── piece_d1001r2p3_start_20220603T080000 # The piece start placeholder, in the format of piece_DSETID_ROUND_ID_PIECEID_DATE_start.
├── piece_d1001r1p1 # The piece directory (frozen piece).
| ├──piece_d1001r1p2_20220601T010101_20220602T010101
| ├──single_piece_info
| ├──tenant_archive_piece_infos
| ├──checkpoint # The checkpoint directory.
| ├── ├──checkpoint_info_0
| ├── ├──checkpoint_info_1
| ├──piece_file_info # The list of all log stream files.
| ├──logstream_0 # The log stream directory.
| ├── ├──ls_file_info # The list of log stream files.
| | ├── 1 # The log stream files.
| | ├── 2
| | ├── 3
| ├──logstream_1 # The log stream directory.
| ├── ├──ls_file_info # The list of log stream files.
| | ├── 1 # The log stream files.
| | ├── 2
| | ├── 3
├── piece_d1001r1p2 # The piece directory (frozen piece).
| ├──piece_d1001r1p2_20220602T010101_20220602T120000
| ├──single_piece_info
| ├──tenant_archive_piece_infos
| ├──checkpoint # The checkpoint directory.
| ├── ├──checkpoint_info_0
| ├──piece_file_info # The list of all log stream files.
| ├──logstream_0 # The log stream directory.
| ├── ├──ls_file_info # The list of log stream files.
| | ├── 4 # The log stream files.
| | ├── 5
| ├──logstream_1 # The log stream directory.
| ├── ├──ls_file_info # The list of log stream files.
| | ├── 4 # The log stream files.
├── piece_d1001r2p3 # The piece directory (active piece).
| ├──tenant_archive_piece_infos
| ├──checkpoint # The checkpoint directory.
| ├── ├──checkpoint_info_0
| ├──logstream_0 # The log stream directory.
| | ├── 6 # The log stream files.
| ├──logstream_1 # The log stream directory.
| | ├── 5 # The log stream files.
OceanBase Database supports tenant-level recovery, which allows you to create a tenant based on the existing data backup. You can execute the alter system restore tenant statement to recover the data. The recovery process consists of the restoration and recovery of the system tables and user tables of the tenant. The restoration process restores the specified baseline data to the OBServer node of the target tenant. The recovery process recovers the logs of the baseline data to the corresponding OBServer node.