This topic describes how to use dump_backup. dump_backup is a feature of ob_admin that parses the data content of a physical backup.
help command
You can run the following command to query the help information of dump_backup:
./ob_admin dump_backup --help
The command output is as follows:
Usage: dump_backup command [command args] [options]
commands:
-h,--help display this message.
options:
-d,--backup-file-path absolute backup file path with file prefix
-s,--storage-info oss/cos should provide storage info
-f,--file-path relative data file path
-o,--offset data offset
-l,--length data length
-c,--check-exist check file is exist or not
samples:
dump meta:
ob_admin dump_backup -dfile:///home/admin/backup_info
dump macro:
ob_admin dump_backup -dfile:///home/admin/macro_block_1.0 -o1024 -l2048
dump data with -f:
ob_admin dump_backup -f/home/admin/macro_block_1.0 -o1024 -l2048
dump data with -s:
ob_admin dump_backup -d'oss://home/admin/backup_info' -s'host=xxx.com&access_id=111&access_key=222'
ob_admin dump_backup -d'cos://home/admin/backup_info' -s'host=xxx.com&access_id=111&access_key=222&appid=333'
Here’s how to use these options:
| Option | Required? | Data type | Default value | Description |
|---|---|---|---|---|
| -d/–backup-file-path | Yes | String | N/A | The absolute path to the data backup file. |
| -s/–storage-info | No | String | N/A | The host address and verification information of the object storage. The verification information includes the access ID (access_id) and access key (access_key). For Amazon S3, you must specify the region (s3_region). |
| -f/–file-path | No | String | N/A | The relative path of the backup file.
NoticeThis option is deprecated. Do not configure it. |
| -o/–offset | No | Integer | 0 | The offset for reading. This value varies based on the type of backup file.
|
| -l/–length | No | Integer | 0 | The length for reading. This value varies based on the type of backup file.
|
| -c, /–check-exist | No | Boolean | false | Specifies whether to check whether the backup file exists. If specified, the command checks whether the input backup file exists. If the file exists, it prints true. Otherwise, it prints false. |
Examples
View the full backup information about the current tenant
./ob_admin dump_backup -dfile:///home/admin/backup/ob_backup_oracle_tenant/data/backup_set_1_full/tenant_backup_set_infos.obbak
The command output is as follows:
------------------------------{Backup Common Header}------------------------------
| data_type|27
| header_version|1
| data_version|1
| compressor_type|1
| header_length|48
| header_checksum|-3262
| data_length|173
| data_zlength|173
| data_checksum|3011330068
| align_length|0
--------------------------------------------------------------------------------
------------------------------{tenant backup set infos}------------------------------
| 1|{backup_set_id:1, incarnation:1, tenant_id:1002, dest_id:1001, backup_type:{type:1}, plus_archivelog:false, date:20230224, prev_full_backup_set_id:0, prev_inc_backup_set_id:0, stats:{input_bytes:24003314, output_bytes:24003314, tablet_count:1106, finish_tablet_count:1106, macro_block_count:251, finish_macro_block_count:251, extra_bytes:0, finish_file_count:0}, start_time:1677225213079065, end_time:0, status:1, result:0, encryption_mode:0, passwd:"", file_status:0, backup_path:"file:///data/test/user_backup/ob_backup_oracle_tenant/data", start_replay_scn:{val:1677225090023122807}, min_restore_scn:{val:1677225275520986000}, tenant_compatible:17179934720, backup_compatible:1, data_turn_id:1, meta_turn_id:1}
View log stream metadata
$./ob_admin dump_backup -dfile:///home/admin/backup/ob_backup_oracle_tenant/data/backup_set_1_full/logstream_1/meta_info_turn_1_retry_0/ls_meta_info.obbak
The command output is as follows:
------------------------------{Backup File Header}------------------------------
| magic|-1410727888
| version|0
| file_type|65536
| compressor_type|0
--------------------------------------------------------------------------------
View the major macroblock index
$./ob_admin dump_backup -dfile:///home/admin/backup/ob_backup_oracle_tenant/data/backup_set_1_full/infos/data_info_turn_1/tenant_major_data_macro_range_index.0.obbak
The command output is as follows:
------------------------------{Backup File Header}------------------------------
| magic|7967
| version|1
| file_type|1
| compressor_type|0
--------------------------------------------------------------------------------
------------------------------{Backup Common Header}------------------------------
| data_type|4
| header_version|1
| data_version|0
| compressor_type|1
| header_length|48
| header_checksum|-30018
| data_length|3637
| data_zlength|3637
| data_checksum|1987640562
| align_length|0
--------------------------------------------------------------------------------
------------------------------{Backup Multi Level Index Header}------------------------------
| magic|-1
| backup_type|4
| index_level|0
--------------------------------------------------------------------------------
------------------------------{Backup Macro Range Index}------------------------------
| start_key:tablet_id|1
| start_key:logic_version|1677225092915334139
| start_key:data_seq|0
| end_key:tablet_id|1
| end_key:logic_version|1677225092915334139
| end_key:data_seq|0
| backup_set_id|1
| ls_id|1
| turn_id|1
| retry_id|0
| file_id|0
| offset|9183232
| length|2463
--------------------------------------------------------------------------------
------------------------------{Backup Macro Range Index}------------------------------
| start_key:tablet_id|3
| start_key:logic_version|1677225092915334139
| start_key:data_seq|0
| end_key:tablet_id|3
| end_key:logic_version|1677225092915334139
| end_key:data_seq|0
| backup_set_id|1
| ls_id|1
| turn_id|1
| retry_id|0
| file_id|0
| offset|9183232
| length|2463
--------------------------------------------------------------------------------
······
------------------------------{Backup Macro Range Index}------------------------------
| start_key:tablet_id|1152921504606846977
| start_key:logic_version|1677225092915334139
| start_key:data_seq|0
| end_key:tablet_id|1152921504606846977
| end_key:logic_version|1677225092915334139
| end_key:data_seq|0
| backup_set_id|1
| ls_id|1001
| turn_id|1
| retry_id|0
| file_id|0
| offset|36864
| length|136
--------------------------------------------------------------------------------
------------------------------{Backup Common Header}------------------------------
| data_type|0
| header_version|1
| data_version|0
| compressor_type|1
| header_length|48
| header_checksum|-28423
| data_length|96
| data_zlength|96
| data_checksum|1663955940
| align_length|0
--------------------------------------------------------------------------------
------------------------------{Backup Multi Level Index Header}------------------------------
| magic|-1
| backup_type|0
| index_level|1
--------------------------------------------------------------------------------
------------------------------{Backup Macro Range Index Index}------------------------------
| end_key:start_key|{data_seq:0, logic_version:1677225092915334139, tablet_id:1152921504606846977}
| end_key:end_key|{data_seq:0, logic_version:1677225092915334139, tablet_id:1152921504606846977}
| end_key:backup_set_id|1
| end_key:ls_id|1001
| end_key:turn_id|1
| end_key:retry_id|0
| end_key:file_id|0
| end_key:offset|36864
| end_key:length|136
| offset|4096
| length|3685
--------------------------------------------------------------------------------
------------------------------{Index File Trailer}------------------------------
| file_type|0
| tree_height|1
| last_block_offset|7781
| last_block_length|144
| checksum|7924
--------------------------------------------------------------------------------
View the diagnostic information about a backup set
./ob_admin dump_backup -dfile:///home/admin/backup/ob_backup_oracle_tenant/data/backup_set_1_full/infos/diagnose_info.obbak
The command output is as follows:
------------------------------{Backup Common Header}------------------------------
| data_type|13
| header_version|1
| data_version|1
| compressor_type|1
| header_length|48
| header_checksum|991
| data_length|300
| data_zlength|300
| data_checksum|2397211904
| align_length|0
--------------------------------------------------------------------------------
------------------------------{diagnose info}------------------------------
------------------------------{locality info}------------------------------
| tenant_id|1002
| tenant_name|backup_oracle_tenant
| backup_set_id|1
| cluster_id|1
| cluster_name|ob_cluster_01
| compat_mode|1
| locality|FULL{1}@z1, FULL{1}@z2, FULL{1}@z3
| primary_zone|z1;z2,z3
--------------------------------------------------------------------------------
------------------------------{backup set info}------------------------------
| tenant_id|1002
| backup_set_id|1
| dest_id|1001
| incarnation|1
| backup_type|FULL
| backup_date|20230224
| prev_full_backup_set_id|0
| prev_inc_backup_set_id|0
| input_bytes|24003314
| output_bytes|24003314
| tablet_count|1106
| finish tablet count|1106
| macro block count|251
| finish macro block count|251
| extra_meta_bytes|0
| finish file count|0
| start_time|1677225213079065
| end_time|1677225276556635
| status|1
| result|0
| encryption_mode|0
| passwd|
| file_status|0
| backup_path|file:///data/test/user_backup/ob_backup_oracle_tenant/data
| start_replay_scn|1677225090023122807
| min_restore_scn|1677225275520986000
| tenant_compatible|17179934720
| backup_compatible|1
| meta_turn_id|1
| data_turn_id|1
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
View the metadata of all log streams
./ob_admin dump_backup -dfile:///home/admin/backup/ob_backup_oracle_tenant/data/backup_set_1_full/infos/meta_info/ls_meta_infos.obbak
The command output is as follows:
------------------------------{Backup Common Header}------------------------------
| data_type|13
| header_version|1
| data_version|1
| compressor_type|1
| header_length|48
| header_checksum|991
| data_length|300
| data_zlength|300
| data_checksum|2397211904
| align_length|0
--------------------------------------------------------------------------------
------------------------------{diagnose info}------------------------------
------------------------------{locality info}------------------------------
| tenant_id|1002
| tenant_name|backup_oracle_tenant
| backup_set_id|1
| cluster_id|1
| cluster_name|ob_cluster_01
| compat_mode|1
| locality|FULL{1}@z1, FULL{1}@z2, FULL{1}@z3
| primary_zone|z1;z2,z3
--------------------------------------------------------------------------------
------------------------------{backup set info}------------------------------
| tenant_id|1002
| backup_set_id|1
| dest_id|1001
| incarnation|1
| backup_type|FULL
| backup_date|20230224
| prev_full_backup_set_id|0
| prev_inc_backup_set_id|0
| input_bytes|24003314
| output_bytes|24003314
| tablet_count|1106
| finish tablet count|1106
| macro block count|251
| finish macro block count|251
| extra_meta_bytes|0
| finish file count|0
| start_time|1677225213079065
| end_time|1677225276556635
| status|1
| result|0
| encryption_mode|0
| passwd|
| file_status|0
| backup_path|file:///data/test/user_backup/ob_backup_oracle_tenant/data
| start_replay_scn|1677225090023122807
| min_restore_scn|1677225275520986000
| tenant_compatible|17179934720
| backup_compatible|1
| meta_turn_id|1
| data_turn_id|1
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
View the start placeholder for a full backup
./ob_admin dump_backup -dfile:///home/admin/backup/ob_backup_oracle_tenant/data/backup_sets/backup_set_1_full_start.obbak
The command output is as follows:
------------------------------{Backup Common Header}------------------------------
| data_type|23
| header_version|1
| data_version|1
| compressor_type|1
| header_length|48
| header_checksum|22833
| data_length|6
| data_zlength|6
| data_checksum|2748775104
| align_length|0
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
General files
| File directory | Description |
|---|---|
| /data/backup_set_1_full/ | The full backup set. |
| /data/backup_set_1_full/backup_set_1_full_20230111T193330_20230111T193420.obbak | The placeholders that indicate the start time and end time of a full backup. |
| /data/backup_set_1_full/infos/data_info_turn_1/ | The tenant-level backup files when turn_id=1. |
| /data/backup_set_1_full/infos/data_info_turn_1/tablet_log_stream_info.obbak | The file of mappings between tablets and log streams. |
| /data/backup_set_1_full/infos/data_info_turn_1/tenant_major_data_macro_range_index.0.obbak | The major macroblock index. |
| /data/backup_set_1_full/infos/data_info_turn_1/tenant_major_data_meta_index.0.obbak | The major meta index. |
| /data/backup_set_1_full/infos/data_info_turn_1/tenant_major_data_sec_meta_index.0.obbak | The mappings between the major logical IDs and physical IDs. |
| /data/backup_set_1_full/infos/data_info_turn_1/tenant_minor_data_macro_range_index.0.obbak | The minor macroblock index. |
| /data/backup_set_1_full/infos/data_info_turn_1/tenant_minor_data_meta_index.0.obbak | The minor meta index. |
| /data/backup_set_1_full/infos/data_info_turn_1/tenant_minor_data_sec_meta_index.0.obbak | The mappings between the minor logical IDs and physical IDs. |
| /data/backup_set_1_full/infos/diagnose_info.obbak | The diagnostic information file of the current backup set. |
| /data/backup_set_1_full/infos/locality_info.obbak | The locality of the tenant to which the current backup set belongs. |
| /data/backup_set_1_full/infos/locality_info.obbak | The locality of the tenant to which the current backup set belongs. |
| /data/backup_set_1_full/infos/meta_info/ls_attr_info.1.obbak | The snapshots of the list of log streams during backup. |
| /data/backup_set_1_full/infos/meta_info/ls_meta_infos.obbak | The metadata of all log streams. |
| /data/backup_set_1_full/logstream_1/ | Log stream 1. |
| /data/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/ | The baseline data when turn_id=1 and retry_id=0. |
| /data/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/macro_block_data.0.obbak | A data file, which ranges from 512 MB to 4 GB in size. |
| /data/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/macro_range_index.obbak | The macro index. |
| /data/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/meta_index.obbak | The meta index. |
| /data/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/sec_meta_index.obbak | The mappings between logical IDs and physical IDs. |
| /data/backup_set_1_full/logstream_1/meta_info_turn_1_retry_0/ | The metadata of the log stream when turn_id=1 and retry_id=0. |
| /data/backup_set_1_full/logstream_1/meta_info_turn_1_retry_0/ls_meta_info.obbak | The log stream metadata. |
| /data/backup_set_1_full/logstream_1/minor_data_turn_1_retry_0/ | The minor compaction data when turn_id=1 and retry_id=0. |
| /data/backup_set_1_full/logstream_1/sys_data_turn_1_retry_0/ | The system tablet data when turn_id=1 and retry_id=0. |
| /data/backup_set_1_full/logstream_1001/ | Log stream 1001. |
| /data/backup_set_1_full/single_backup_set_info.obbak | The metadata of the current backup set. |
| /data/backup_set_1_full/tenant_backup_set_infos.obbak | The full backup information about the current tenant. |
| /data/backup_sets/ | The placeholder of the backup set, which is used in a list. |
| /data/backup_sets/backup_set_1_full_end_success_20230111T193420.obbak | The end placeholder for a full backup. |
| /data/backup_sets/backup_set_1_full_start.obbak | The start placeholder for a full backup. |
| /data/backup_sets/backup_set_2_inc_start.obbak | The start placeholder for an incremental backup. |
| /data/backup_sets/backup_set_2_inc_end_success_20230111T194420.obbak | The end placeholder for an incremental backup. |
| /data/check_file/1002_connect_file_20230111T193020.obbak | The connectivity check file. |
| /data/format.obbak | The format information about the backup path. |