目的:
1)恢复系统表的数据 2)恢复系统表的日志 3)修正系统表的数据 4)恢复用户表的数据 5)恢复用户表的日志
2.1 前提条件
存在成功备份可恢复的数据。 集群正常运行,并且剩余资源足够创建恢复租户。
2.2 单表恢复流程
2.2.1 检查备份情况
select * from cdb_ob_backup_archivelog_summary;SELECT * FROM CDB_OB_BACKUP_SET_DETAILS order by start_time desc limit 6;2.2.2 恢复前准备
CREATE RESOURCE UNIT restore_unit_2c6G max_cpu 2, max_memory
6442450944, max_iops 10240, max_disk_size 53687091200,
max_session_num 64, MIN_CPU=2, MIN_MEMORY=6442450944, MIN_IOPS=10240;CREATE RESOURCE POOL restore_2c6G_pool_1 unit =
'restore_unit_2c6G', unit_num = 1, zone_list = ('zone1','zone2','zone3');show parameters like 'restore_concurrency';ALTER SYSTEM SET restore_concurrency = 20;select zone, name, value from __all_zone where name in ('frozen_version', 'last_merged_version');SELECT * FROM __all_zone WHERE name='merge_status';2.2.3 发起单表恢复
ALTER SYSTEM RESTORE <OWNER>.<TABLE_NAME> FOR
<NEW_TENANT_NAME> FROM <OLD_TENANT_NAME> AT 'file:///obbackup/' UNTIL '2023-11-30 12:00:00' WITH
'backup_cluster_name=ob_test&backup_cluster_id=xxx&pool_list=restore_2c6G_pool';ALTER SYSTEM RESTORE OMS_MIGRATE.TEST1 FOR restore_20231130
FROM hbjhdb AT 'file:///data/nfs/' UNTIL '2023-11-30 17:15:41' WITH
'backup_cluster_name=yewujihe&backup_cluster_id=1687507918&pool_list=restore_2c6G_pool_1';select * from CDB_OB_RESTORE_PROGRESS\Gselect svr_ip,role,is_restore,count(*) from __all_root_table a,
(select value from __all_restore_info) as b
where a.tenant_id=b.value
group by role,is_restore,svr_ip
order by svr_ip,is_restore;select svr_ip,role,is_restore,count(*) from __all_virtual_meta_table a,
(select value from __all_restore_info) as b
where a.tenant_id=b.value
group by role,is_restore,svr_ip
order by svr_ip,is_restore;select * from CDB_OB_RESTORE_HISTORY where tenant_name = 'restore_20231130' and status = 'RESTORE_SUCCESS'\Gselect * from __all_rootservice_event_history where module='physical_restore' and value2 = 'restore_20231130' order by gmt_create desc;「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




