dump_backup is a feature of ob_admin that parses the data content of a physical backup. This topic describes how to use dump_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'
The following table describes the options.
| Option | Required? | Data type | Default value | Description |
|---|---|---|---|---|
| -d/--backup-file-path | Yes | String | N/A | The absolute path of the data backup file. |
| -s/--storage-info | No | String | N/A | The host address and authentication information for object storage. The authentication information includes access_id and access_key. For Amazon Simple Storage Service (S3), s3_region is also required. |
| -f/--file-path | No | String | N/A | The relative path of the data backup file.
NoticeThis option is deprecated. Do not use it. |
| -o/--offset | No | Integer | 0 | The offset, whose meaning varies depending on the type of the specified data backup file.
|
| -l/--length | No | Integer | 0 | The length, whose meaning varies depending on the type of the specified data backup file.
|
| -c/--check-exist | No | Boolean | false | Specifies whether to check the existence of the data backup file. If you set this option to true, the command checks whether the specified data backup file exists. If the file exists, true is returned. If the file does not exist, false is returned. |
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 user table names included in a backup set
Obtains the values of
countandbatch_sizefor the table_list file.$ ./ob_admin dump_backup -d'file:///home/admin/backup/ob_backup_oracle_tenant/data/backup_set_1_full/infos/table_list'The command output is as follows:
-------------------table_list--------------------—- | count|100000 | batch_size|20000Specify
--offsetand--lengthbased on the output value ofcount.$ ./ob_admin dump_backup -d'file:///home/admin/backup/ob_backup_oracle_tenant/data/backup_set_1_full/infos/table_list' --offset=1 --length=3The preceding command reads 3 entries (length), starting from the second entry (offset + 1) in the full table_list file. The command output is as follows:
-------------------table_list--------------------—- | 2|{database_name:d2, table_name:t2} | 3|{database_name:d3, table_name:t3} | 4|{database_name:d4, table_name:t4}
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
This section describes general data backup files used during the execution of dump_backup commands. ${backup_data_path} specifies the backup path, which you can replace as needed. For more information, see Preparations.
| File directory | Description |
|---|---|
| ${backup_data_path}/backup_set_1_full/ | The full backup set. |
| ${backup_data_path}/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. |
| ${backup_data_path}/backup_set_1_full/single_backup_set_info.obbak | The metadata of the current backup set. |
| ${backup_data_path}/backup_set_1_full/tenant_backup_set_infos.obbak | The full backup information about the current tenant. |
| ${backup_data_path}/backup_set_1_full/infos/table_list | The file that contains the names of all tables. |
| ${backup_data_path}/backup_set_1_full/infos/table_list/table_list.1702352553000000000.1.obbak | File 1, which contains the names of tables involved in snapshot 1. |
| ${backup_data_path}/backup_set_1_full/infos/table_list/table_list.1702352553000000000.2.obbak | File 2, which contains the names of tables involved in snapshot 1. |
| ${backup_data_path}/backup_set_1_full/infos/table_list/table_list_meta_info.1702352553000000000.obbak | The file that contains the metadata of tables involved in snapshot 1. |
| ${backup_data_path}/backup_set_1_full/infos/major_data_info_turn_1/ | The tenant-level backup files when the major turn ID is 1. |
| ${backup_data_path}/backup_set_1_full/infos/major_data_info_turn_1/tablet_log_stream_info.obbak | The file of mappings between tablets and log streams. |
| ${backup_data_path}/backup_set_1_full/infos/major_data_info_turn_1/tenant_major_data_macro_range_index.0.obbak | The major macroblock index. |
| ${backup_data_path}/backup_set_1_full/infos/major_data_info_turn_1/tenant_major_data_meta_index.0.obbak | The major meta index. |
| ${backup_data_path}/backup_set_1_full/infos/major_data_info_turn_1/tenant_major_data_sec_meta_index.0.obbak | The mappings between the major logical IDs and physical IDs. |
| ${backup_data_path}/backup_set_1_full/infos/minor_data_info_turn_1/ | The tenant-level backup files when the minor turn ID is 1. |
| ${backup_data_path}/backup_set_1_full/infos/minor_data_info_turn_1/tablet_log_stream_info.obbak | The file of mappings between tablets and log streams. |
| ${backup_data_path}/backup_set_1_full/infos/minor_data_info_turn_1/tenant_minor_data_macro_range_index.0.obbak | The minor macroblock index. |
| ${backup_data_path}/backup_set_1_full/infos/minor_data_info_turn_1/tenant_minor_data_meta_index.0.obbak | The minor meta index. |
| ${backup_data_path}/backup_set_1_full/infos/minor_data_info_turn_1/tenant_minor_data_sec_meta_index.0.obbak | The mappings between the minor logical IDs and physical IDs. |
| ${backup_data_path}/backup_set_1_full/infos/diagnose_info.obbak | The diagnostic information file of the current backup set. |
| ${backup_data_path}/backup_set_1_full/infos/locality_info.obbak | The locality of the tenant to which the current backup set belongs. |
| ${backup_data_path}/backup_set_1_full/infos/meta_info/ls_attr_info.1.obbak | The snapshots of the list of log streams during backup. |
| ${backup_data_path}/backup_set_1_full/infos/meta_info/ls_meta_infos.obbak | The metadata of all log streams. |
| ${backup_data_path}/backup_set_1_full/logstream_1/ | Log stream 1. |
| ${backup_data_path}/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/ | The baseline data when the turn ID is 1 and the retry ID is 0. |
| ${backup_data_path}/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. |
| ${backup_data_path}/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/macro_range_index.obbak | The macro index. |
| ${backup_data_path}/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/meta_index.obbak | The meta index. |
| ${backup_data_path}/backup_set_1_full/logstream_1/major_data_turn_1_retry_0/sec_meta_index.obbak | The mappings between logical IDs and physical IDs. |
| ${backup_data_path}/backup_set_1_full/logstream_1/meta_info_turn_1_retry_0/ | The metadata of the log stream when the turn ID is 1 and the retry ID is 0. |
| ${backup_data_path}/backup_set_1_full/logstream_1/meta_info_turn_1_retry_0/ls_meta_info.obbak | The log stream metadata. |
| ${backup_data_path}/backup_set_1_full/logstream_1/meta_info_turn_1_retry_0/tablet_info.1.obbak | The metadata of log stream tablets. |
| ${backup_data_path}/backup_set_1_full/logstream_1/minor_data_turn_1_retry_0/ | The minor compaction data when the turn ID is 1 and the retry ID is 0. |
| ${backup_data_path}/backup_set_1_full/logstream_1/sys_data_turn_1_retry_0/ | The system tablet data when the turn ID is 1 and the retry ID is 0. |
| ${backup_data_path}/backup_set_1_full/logstream_1001/ | Log stream 1001. |
| ${backup_data_path}/backup_sets/ | The summary directory that contains all data backup sets. |
| ${backup_data_path}/backup_sets/backup_set_1_full_end_success_20230111T193420.obbak | The end placeholder for a full backup. |
| ${backup_data_path}/backup_sets/backup_set_1_full_start.obbak | The start placeholder for a full backup. |
| ${backup_data_path}/backup_sets/backup_set_2_inc_start.obbak | The start placeholder for an incremental backup. |
| ${backup_data_path}/backup_sets/backup_set_2_inc_end_success_20230111T194420.obbak | The end placeholder for an incremental backup. |
| ${backup_data_path}/check_file/1002_connect_file_20230111T193020.obbak | The connectivity check file. |
| ${backup_data_path}/format.obbak | The format information of the backup path. |