首批通过分布式安全可靠测评,为关键业务系统打造
Restore 单表失败
更新时间:2026-05-13 07:31
适用版本
OceanBase 数据库 V2.x、V3.X 版本。
问题描述
使用黑屏单表恢复租户。
create resource unit unit_2c8g max_cpu=2, min_cpu=2, max_memory='8g', min_memory='8g', max_iops=10000, min_iops=1000, max_session_num=1000000, max_disk_size='500g';
create resource pool restore_pool_rst unit = 'unit_2c8g', unit_num = 1;
alter system set restore_concurrency = 50;
alter system restore db1.tb1 for rst_oracle from ob_oracle at 'cos://' until '2023-07-21 22:40:18' with 'backup_cluster_name=obcluster&backup_cluster_id=1637xxxxxx&pool_list=restore_pool_rst&locality=F@zone1,F@zone2,F@zone3&primary_zone=zone1,zone2,zone3';
恢复失败,查看 restore history 表 ,显示 RESTORE_FAIL。
obclient [oceanbase]> select * from oceanbase.CDB_OB_RESTORE_HISTORY where JOB_ID=483\G;
*************************** 1. row ***************************
JOB_ID: 483
EXTERNAL_JOB_ID: -1
TENANT_ID: 1184
TENANT_NAME: rst_oracle
BACKUP_TENANT_ID: 1001
BACKUP_TENANT_NAME: ob_oracle
BACKUP_CLUSTER_ID: 1637xxxxxx
BACKUP_CLUSTER_NAME: obcluster
WHITE_LIST: `db1`.`tb1`
STATUS: RESTORE_FAIL
START_TIME: 2023-07-27 18:15:50.268125
COMPLETION_TIME: 2023-07-27 18:20:19.914677
PARTITION_COUNT: 128
MACRO_BLOCK_COUNT: -1
FINISH_PARTITION_COUNT: 128
FINISH_MACRO_BLOCK_COUNT: -1
RESTORE_START_TIMESTAMP: 2023-07-19 05:00:05.272017
RESTORE_FINISH_TIMESTAMP: 2023-07-21 22:40:18.000000
RESTORE_CURRENT_TIMESTAMP: NULL
BACKUP_SET_LIST: cos://***ata/xxxxxxxx
BACKUP_PIECE_LIST: cos://***csp.xxxxxxxx&appid=xxxxxx?host=c
INFO: ROOTSERVICE : OB_NOT_SUPPORTED(-4007) on "xxx.xxx.xxx.xxx:2882" with traceid YBxxxxxxxxxx-0005F7xxxxxxxxxx
1 row in set (0.005 sec)
可以看到,报错 database not exist,db1 这个库不存在。
[2023-07-27 18:20:19.903427] WARN [RS.RESTORE] gen_white_list (ob_restore_scheduler.cpp:1886) [299954][752][YBxxxxxxxxxx-0005Fxxxxxxxxxx] [lt=12] [dc=0] database not exist(ret=-4007, ret="OB_NOT_SUPPORTED", item={database_name:"db1", table_name:"tb1"})
对比源库信息,源库库名为大写 DB1。
问题原因
数据库名和表名在黑屏恢复时需要保持大小写一致。否则会报 database not exist。
解决方案
修改黑屏执行命令。
alter system restore DB1.TB1 for rst_oracle from ob_oracle at 'cos://' until '2023-07-21 22:40:18' with 'backup_cluster_name=obcluster&backup_cluster_id=1637568272&pool_list=restore_pool_rst&locality=F@zone1,F@zone2,F@zone3&primary_zone=zone1,zone2,zone3';
恢复成功 RESTORE_SUCCESS。
obclient [oceanbase]> select * from oceanbase.CDB_OB_RESTORE_HISTORY where JOB_ID=485\G
*************************** 1. row ***************************
JOB_ID: 485
EXTERNAL_JOB_ID: -1
TENANT_ID: 1185
TENANT_NAME: rst_oracle
BACKUP_TENANT_ID: 1001
BACKUP_TENANT_NAME: ob_oracle
BACKUP_CLUSTER_ID: 1637xxxxxx
BACKUP_CLUSTER_NAME: obcluster
WHITE_LIST: `DB1`.`TB1`
STATUS: RESTORE_SUCCESS
START_TIME: 2023-07-27 20:06:24.428165
COMPLETION_TIME: 2023-07-27 20:17:21.400813
PARTITION_COUNT: 1
MACRO_BLOCK_COUNT: -1
FINISH_PARTITION_COUNT: 1
FINISH_MACRO_BLOCK_COUNT: -1
RESTORE_START_TIMESTAMP: 2023-07-19 05:00:05.272017
RESTORE_FINISH_TIMESTAMP: 2023-07-21 22:40:18.000000
RESTORE_CURRENT_TIMESTAMP: NULL
BACKUP_SET_LIST:
BACKUP_PIECE_LIST:
INFO:
1 row in set (0.002 sec)