OceanBase物理備份恢復實踐
環境說明:
ob 323版本
作業系統為:redhat 7.6
====配置叢集備份
root登入sys租戶
[root@dbdriver ~]# obclient -h192.168.15.66 -P2883 -uroot@sys#Gaoyc:1667379307 '-pan~7&jtGcd|F43uoo*AOK' -A
MySQL [(none)]> show parameters like 'backup_dest'
-> ;
+-------+----------+--------------+----------+-------------+-----------+-------------------+-------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level |
+-------+----------+--------------+----------+-------------+-----------+-------------------+-------------+----------+---------+---------+-------------------+
| zone2 | observer | 192.168.15.67 | 2882 | backup_dest | NULL | file:///backupob/ | backup dest | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | backup_dest | NULL | file:///backupob/ | backup dest | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | 192.168.15.66 | 2882 | backup_dest | NULL | file:///backupob/ | backup dest | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
MySQL [(none)]> alter system set backup_dest='file:///nfsbackup/gaoyc';
ERROR 9036 (HY000): Backup is in progress
關閉日誌備份
MySQL [oceanbase]> alter system noarchivelog;
Query OK, 0 rows affected (0.110 sec)
MySQL [oceanbase]> alter system set backup_dest='file:///nfsbackup/gaoyc';
Query OK, 0 rows affected (0.046 sec)
配置備份策略
MySQL [oceanbase]> alter system set backup_dest_option='log_archive_checkpoint_interval=2m&recovery_window=7&auto_delete_obsolete_backup=true&log_archive_piece_switch_interval=1d&backup_copies=0';
Query OK, 0 rows affected (0.046 sec)
MySQL [oceanbase]> show parameters like 'backup_dest_option';
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level |
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------------+----------+---------+---------+-------------------+
| zone2 | observer | 192.168.15.67 | 2882 | backup_dest_option | NULL | | backup_dest_option | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | backup_dest_option | NULL | | backup_dest_option | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | 192.168.15.66 | 2882 | backup_dest_option | NULL | | backup_dest_option | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------------+----------+---------+---------+-------------------+
3 rows in set (0.020 sec)
MySQL [oceanbase]> alter system set backup_dest_option='log_archive_checkpoint_interval=2m&recovery_window=7&auto_delete_obsolete_backup=true&log_archive_piece_switch_interval=1d&backup_copies=0';
Query OK, 0 rows affected (0.046 sec)
MySQL [oceanbase]> show parameters like 'backup_dest_option';
+-------+----------+--------------+----------+--------------------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------+--------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level |
+-------+----------+--------------+----------+--------------------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------+--------------------+----------+---------+---------+-------------------+
| zone3 | observer | 192.168.15.68 | 2882 | backup_dest_option | NULL | log_archive_checkpoint_interval=2m&recovery_window=7&auto_delete_obsolete_backup=true&log_archive_piece_switch_interval=1d&backup_copies=0 | backup_dest_option | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | backup_dest_option | NULL | log_archive_checkpoint_interval=2m&recovery_window=7&auto_delete_obsolete_backup=true&log_archive_piece_switch_interval=1d&backup_copies=0 | backup_dest_option | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | 192.168.15.66 | 2882 | backup_dest_option | NULL | log_archive_checkpoint_interval=2m&recovery_window=7&auto_delete_obsolete_backup=true&log_archive_piece_switch_interval=1d&backup_copies=0 | backup_dest_option | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+--------------+----------+--------------------+-----------+--------------------------------------------------------------------------------------------------------------------------------------------+--------------------+----------+---------+---------+-------------------+
3 rows in set (0.029 sec)
log_archive_checkpoint_interval:控制冷分割槽checkpoint任務的生成間隔,推進其歸檔速度,預設120s
recovery_window:備份清理週期,預設是0,不清理
auto_delete_obsolete_backup:配置是否啟用自動清理,不配置,預設按照叢集的auto_delete_expired_backup
log_archive_piece_switch_interval:控制按照時間段切日誌檔案的目錄,有效為1d-7d,預設為0,不開啟
backup_copies:控制備份的冗餘度,預設為0,建議配置為2,有效為0-8
==發起日誌備份:
包括兩種,一種為option,一種為mandatory
配置日誌壓縮及壓縮演算法,預設為開啟壓縮
MySQL [oceanbase]> show parameters like 'backup_log_archive_option';
+-------+----------+--------------+----------+---------------------------+-----------+-----------------------------+--------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level |
+-------+----------+--------------+----------+---------------------------+-----------+-----------------------------+--------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone1 | observer | 192.168.15.66 | 2882 | backup_log_archive_option | NULL | OPTIONAL COMPRESSION=ENABLE | backup log archive option, support MANDATORY/OPTIONAL, COMPRESSION | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | backup_log_archive_option | NULL | OPTIONAL COMPRESSION=ENABLE | backup log archive option, support MANDATORY/OPTIONAL, COMPRESSION | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | backup_log_archive_option | NULL | OPTIONAL COMPRESSION=ENABLE | backup log archive option, support MANDATORY/OPTIONAL, COMPRESSION | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+--------------+----------+---------------------------+-----------+-----------------------------+--------------------------------------------------------------------+----------+---------+---------+-------------------+
3 rows in set (0.020 sec)
MySQL [oceanbase]> alter system set backup_log_archive_option='OPTIONAL COMPRESSION=zstd_1.3.8';
關閉方式:
alter system set backup_log_archive_option='COMPRESSION=disable';
alter system set backup_log_archive_option='mandatory COMPRESSION=disable';
發起備份[建議發起]:
MySQL [oceanbase]> alter system archivelog;
Query OK, 0 rows affected (0.059 sec)
MySQL [oceanbase]> select * from cdb_ob_backup_archivelog;
+-------------+-------------------+-----------+-----------+----------------+-----------------+----------------------------+---------------+-------------+--------------+-------------------+---------------------+----------------------+
| INCARNATION | LOG_ARCHIVE_ROUND | TENANT_ID | STATUS | START_PIECE_ID | BACKUP_PIECE_ID | MIN_FIRST_TIME | MAX_NEXT_TIME | INPUT_BYTES | OUTPUT_BYTES | COMPRESSION_RATIO | INPUT_BYTES_DISPLAY | OUTPUT_BYTES_DISPLAY |
+-------------+-------------------+-----------+-----------+----------------+-----------------+----------------------------+---------------+-------------+--------------+-------------------+---------------------+----------------------+
| 1 | 2 | 1 | BEGINNING | 1 | 1 | 2023-05-05 14:20:58.585556 | | 0 | 0 | NULL | 0.00MB | 0.00MB |
+-------------+-------------------+-----------+-----------+----------------+-----------------+----------------------------+---------------+-------------+--------------+-------------------+---------------------+----------------------+
1 row in set (0.001 sec)
狀態一直顯示beginning,關閉後提示stopping,檢視observer日誌和RS日誌
[root@db01 log]# pwd
/home/admin/oceanbase/log
[root@db01 log]# tail -100f rootservice.log | grep ob_storage_file [日誌發現許可權問題,要求掛載的nfs為777]
[root@db01 log]# tail -100f observer.log | grep dest
檢視具體狀態
MySQL [oceanbase]> select * from cdb_ob_backup_archivelog_summary;
+-------------+-------------------+-----------+--------+----------------+-----------------+----------------------------+----------------------------+-------------+--------------+-------------------+---------------------+----------------------+
| INCARNATION | LOG_ARCHIVE_ROUND | TENANT_ID | STATUS | START_PIECE_ID | BACKUP_PIECE_ID | MIN_FIRST_TIME | MAX_NEXT_TIME | INPUT_BYTES | OUTPUT_BYTES | COMPRESSION_RATIO | INPUT_BYTES_DISPLAY | OUTPUT_BYTES_DISPLAY |
+-------------+-------------------+-----------+--------+----------------+-----------------+----------------------------+----------------------------+-------------+--------------+-------------------+---------------------+----------------------+
| 1 | 1 | 1 | STOP | 0 | 0 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 2 | 1 | STOP | 1 | 1 | 2023-05-05 14:20:58.585556 | | 0 | 0 | NULL | 0.00MB | 0.00MB |
MySQL [oceanbase]> alter system noarchivelog;
Query OK, 0 rows affected (0.08 sec)
MySQL [oceanbase]> alter system archivelog;
Query OK, 0 rows affected (0.08 sec)
MySQL [oceanbase]>
MySQL [oceanbase]>
MySQL [oceanbase]> select * from cdb_ob_backup_archivelog;
+-------------+-------------------+-----------+--------+----------------+-----------------+----------------------------+----------------------------+-------------+--------------+-------------------+---------------------+----------------------+
| INCARNATION | LOG_ARCHIVE_ROUND | TENANT_ID | STATUS | START_PIECE_ID | BACKUP_PIECE_ID | MIN_FIRST_TIME | MAX_NEXT_TIME | INPUT_BYTES | OUTPUT_BYTES | COMPRESSION_RATIO | INPUT_BYTES_DISPLAY | OUTPUT_BYTES_DISPLAY |
+-------------+-------------------+-----------+--------+----------------+-----------------+----------------------------+----------------------------+-------------+--------------+-------------------+---------------------+----------------------+
| 1 | 3 | 1 | DOING | 2 | 2 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:13:37.230658 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 3 | 1001 | DOING | 2 | 2 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:13:37.230658 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 3 | 1002 | DOING | 2 | 2 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:13:37.230658 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 3 | 1003 | DOING | 2 | 2 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:13:41.027397 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 3 | 1004 | DOING | 2 | 2 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:13:41.027397 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 3 | 1005 | DOING | 2 | 2 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:13:41.027397 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 3 | 1006 | DOING | 2 | 2 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:13:37.230658 | 0 | 0 | NULL | 0.00MB | 0.00MB |
+-------------+-------------------+-----------+--------+----------------+-----------------+----------------------------+----------------------------+-------------+--------------+-------------------+---------------------+----------------------+
MySQL [oceanbase]> select * from cdb_ob_backup_piece_files;
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
| INCARNATION | TENANT_ID | ROUND_ID | BACKUP_PIECE_ID | COPY_ID | CREATE_DATE | START_TS | CHECKPOINT_TS | MAX_TS | STATUS | FILE_STATUS | COMPATIBLE | START_PIECE_ID |
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
| 1 | 1 | 1 | 0 | 0 | 20221103 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 2023-05-05 14:04:16.682178 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1 | 2 | 1 | 0 | 20230505 | 2023-05-05 14:20:58.585556 | | 2023-05-05 15:59:10.237749 | FROZEN | AVAILABLE | 1 | 1 |
| 1 | 1 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:15:14.970021 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1001 | 1 | 0 | 0 | 20221103 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 2023-05-05 14:04:16.359674 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1001 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:15:15.257245 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1002 | 1 | 0 | 0 | 20221103 | 2022-12-14 12:31:47.330210 | | 2023-05-05 14:04:16.367860 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1002 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:15:15.257245 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1003 | 1 | 0 | 0 | 20221103 | 2022-12-14 12:49:47.280891 | 2023-04-23 15:00:48.794748 | 2023-05-05 14:04:16.422139 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1003 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:15:18.319754 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1004 | 1 | 0 | 0 | 20221103 | 2022-12-14 14:43:00.325092 | 2023-04-23 15:00:48.794748 | 2023-05-05 14:04:16.522301 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1004 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:15:18.319754 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1005 | 1 | 0 | 0 | 20221103 | 2023-03-17 14:39:11.551022 | 2023-04-17 14:06:32.471975 | 2023-05-05 14:04:16.622449 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1005 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:15:14.970021 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1006 | 1 | 0 | 0 | 20221103 | 2023-04-18 10:22:14.398825 | | 2023-05-05 14:04:16.682178 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1006 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:15:14.970021 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
MySQL [oceanbase]> select * from cdb_ob_backup_piece_files;
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
| INCARNATION | TENANT_ID | ROUND_ID | BACKUP_PIECE_ID | COPY_ID | CREATE_DATE | START_TS | CHECKPOINT_TS | MAX_TS | STATUS | FILE_STATUS | COMPATIBLE | START_PIECE_ID |
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
| 1 | 1 | 1 | 0 | 0 | 20221103 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 2023-05-05 14:04:16.682178 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1 | 2 | 1 | 0 | 20230505 | 2023-05-05 14:20:58.585556 | | MAX | ACTIVE | AVAILABLE | 1 | 1 |
| 1 | 1001 | 1 | 0 | 0 | 20221103 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 2023-05-05 14:04:16.359674 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1002 | 1 | 0 | 0 | 20221103 | 2022-12-14 12:31:47.330210 | | 2023-05-05 14:04:16.367860 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1003 | 1 | 0 | 0 | 20221103 | 2022-12-14 12:49:47.280891 | 2023-04-23 15:00:48.794748 | 2023-05-05 14:04:16.422139 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1004 | 1 | 0 | 0 | 20221103 | 2022-12-14 14:43:00.325092 | 2023-04-23 15:00:48.794748 | 2023-05-05 14:04:16.522301 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1005 | 1 | 0 | 0 | 20221103 | 2023-03-17 14:39:11.551022 | 2023-04-17 14:06:32.471975 | 2023-05-05 14:04:16.622449 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1006 | 1 | 0 | 0 | 20221103 | 2023-04-18 10:22:14.398825 | | 2023-05-05 14:04:16.682178 | FROZEN | AVAILABLE | 1 | 0 |
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
8 rows in set (0.001 sec)
檢視memstore的使用率,ocp->租戶->效能與監控->儲存與快取
手動轉儲:
MySQL [oceanbase]> alter system minor freeze;
Query OK, 0 rows affected (0.537 sec)
MySQL [oceanbase]> select * from gv$merge_info where START_TIME>now()-3;
Empty set (0.192 sec)
資料備份:
配置備份密碼[可選]
set encryption on identified by 'password' only;
發起全備:
MySQL [oceanbase]> alter system backup database;
Empty set (0.005 sec)
MySQL [oceanbase]> select * from cdb_ob_backup_progress;
Empty set (0.018 sec)
MySQL [oceanbase]> select * from cdb_ob_backup_set_files;
+-------------+-----------+--------+---------+-------------+-----------------+---------+-------------+----------------------------+----------------------------+------------------+------+------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+
| INCARNATION | TENANT_ID | BS_KEY | COPY_ID | BACKUP_TYPE | ENCRYPTION_MODE | STATUS | FILE_STATUS | START_TIME | COMPLETION_TIME | ELAPSED_SECONDES | KEEP | KEEP_UNTIL | COMPRESSED | OUTPUT_BYTES | OUTPUT_RATE_BYTES | COMPRESSION_RATIO | OUTPUT_BYTES_DISPLAY | OUTPUT_RATE_BYTES_DISPLAY | TIME_TAKEN_DISPLAY |
+-------------+-----------+--------+---------+-------------+-----------------+---------+-------------+----------------------------+----------------------------+------------------+------+------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+
| 1 | 1 | 1 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-03 16:13:49.898310 | 2022-11-03 16:18:50.479716 | 301 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.581406 |
| 1 | 1 | 2 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-04 09:44:00.244071 | 2022-11-04 09:49:00.581360 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.337289 |
| 1 | 1 | 3 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-04 10:18:54.562517 | 2022-11-04 10:23:54.884979 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.322462 |
| 1 | 1 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:07.089446 | 45 | NO | | NO | 788821442 | 17704003.5703 | 0.55 | 752.28MB | 16.88MB/S | 00:00:44.556105 |
| 1 | 1001 | 1 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-03 16:13:49.898310 | 2022-11-03 16:18:50.396880 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.498570 |
| 1 | 1001 | 2 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-04 09:44:00.244071 | 2022-11-04 09:49:00.482836 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.238765 |
| 1 | 1001 | 3 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-04 10:18:54.562517 | 2022-11-04 10:23:54.822612 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.260095 |
| 1 | 1001 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:05.508469 | 43 | NO | | NO | 4945475 | 115077.6095 | 0.03 | 4.72MB | 0.11MB/S | 00:00:42.975128 |
| 1 | 1002 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:06.015679 | 43 | NO | | NO | 4238019 | 97465.2973 | 0.07 | 4.04MB | 0.09MB/S | 00:00:43.482338 |
| 1 | 1003 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:00.191137 | 38 | NO | | NO | 4242137 | 112649.6357 | 0.06 | 4.05MB | 0.11MB/S | 00:00:37.657796 |
| 1 | 1004 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:00.621949 | 38 | NO | | NO | 4250330 | 111590.5837 | 0.06 | 4.05MB | 0.11MB/S | 00:00:38.088608 |
| 1 | 1005 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:05.998997 | 43 | NO | | NO | 4944328 | 113752.5222 | 0.05 | 4.72MB | 0.11MB/S | 00:00:43.465656 |
| 1 | 1006 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:06.823030 | 44 | NO | | NO | 766201153 | 17299763.6764 | 0.78 | 730.71MB | 16.50MB/S | 00:00:44.289689 |
+-------------+-----------+--------+---------+-------------+-----------------+---------+-------------+----------------------------+----------------------------+------------------+------+------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+
13 rows in set (0.008 sec)
MySQL [oceanbase]> select * from cdb_ob_backup_piece_files;
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
| INCARNATION | TENANT_ID | ROUND_ID | BACKUP_PIECE_ID | COPY_ID | CREATE_DATE | START_TS | CHECKPOINT_TS | MAX_TS | STATUS | FILE_STATUS | COMPATIBLE | START_PIECE_ID |
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
| 1 | 1 | 1 | 0 | 0 | 20221103 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 2023-05-05 14:04:16.682178 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1 | 2 | 1 | 0 | 20230505 | 2023-05-05 14:20:58.585556 | | 2023-05-05 15:59:10.237749 | FROZEN | DELETED | 1 | 1 |
| 1 | 1 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:34:23.656525 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1001 | 1 | 0 | 0 | 20221103 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 2023-05-05 14:04:16.359674 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1001 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:34:23.946479 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1002 | 1 | 0 | 0 | 20221103 | 2022-12-14 12:31:47.330210 | | 2023-05-05 14:04:16.367860 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1002 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:34:23.946479 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1003 | 1 | 0 | 0 | 20221103 | 2022-12-14 12:49:47.280891 | 2023-04-23 15:00:48.794748 | 2023-05-05 14:04:16.422139 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1003 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:34:27.559667 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1004 | 1 | 0 | 0 | 20221103 | 2022-12-14 14:43:00.325092 | 2023-04-23 15:00:48.794748 | 2023-05-05 14:04:16.522301 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1004 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:34:27.559667 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1005 | 1 | 0 | 0 | 20221103 | 2023-03-17 14:39:11.551022 | 2023-04-17 14:06:32.471975 | 2023-05-05 14:04:16.622449 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1005 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:34:23.656525 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1006 | 1 | 0 | 0 | 20221103 | 2023-04-18 10:22:14.398825 | | 2023-05-05 14:04:16.682178 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1006 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:34:23.656525 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
15 rows in set (0.002 sec)
發起增量備份:
alter system backup incremental database;
MySQL [oceanbase]> select * from cdb_ob_backup_progress;
+-------------+--------+-------------+-----------+-----------------+-------------------+------------------------+--------------------------+-------------+--------------+----------------------------+----------------------------+---------+
| INCARNATION | BS_KEY | BACKUP_TYPE | TENANT_ID | PARTITION_COUNT | MACRO_BLOCK_COUNT | FINISH_PARTITION_COUNT | FINISH_MACRO_BLOCK_COUNT | INPUT_BYTES | OUTPUT_BYTES | START_TIME | COMPLETION_TIME | STATUS |
+-------------+--------+-------------+-----------+-----------------+-------------------+------------------------+--------------------------+-------------+--------------+----------------------------+----------------------------+---------+
| 1 | 5 | I | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2023-05-05 16:56:13.410287 | 2023-05-05 16:56:13.829954 | RUNNING |
| 1 | 5 | I | 1001 | 150 | 0 | 0 | 0 | 0 | 0 | 2023-05-05 16:56:13.410287 | 2023-05-05 16:56:13.801534 | RUNNING |
| 1 | 5 | I | 1002 | 149 | 0 | 0 | 0 | 0 | 0 | 2023-05-05 16:56:13.410287 | 2023-05-05 16:56:13.788439 | RUNNING |
| 1 | 5 | I | 1003 | 149 | 0 | 0 | 0 | 0 | 0 | 2023-05-05 16:56:13.410287 | 2023-05-05 16:56:13.771844 | RUNNING |
| 1 | 5 | I | 1004 | 149 | 0 | 0 | 0 | 0 | 0 | 2023-05-05 16:56:13.410287 | 2023-05-05 16:56:13.745636 | RUNNING |
| 1 | 5 | I | 1005 | 150 | 0 | 0 | 0 | 0 | 0 | 2023-05-05 16:56:13.410287 | 2023-05-05 16:56:13.719549 | RUNNING |
| 1 | 5 | I | 1006 | 209 | 0 | 0 | 0 | 0 | 0 | 2023-05-05 16:56:13.410287 | 2023-05-05 16:56:13.654110 | RUNNING |
+-------------+--------+-------------+-----------+-----------------+-------------------+------------------------+--------------------------+-------------+--------------+----------------------------+----------------------------+---------+
7 rows in set (0.021 sec)
MySQL [oceanbase]> select * from cdb_ob_backup_set_files;
+-------------+-----------+--------+---------+-------------+-----------------+---------+-------------+----------------------------+----------------------------+------------------+------+------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+
| INCARNATION | TENANT_ID | BS_KEY | COPY_ID | BACKUP_TYPE | ENCRYPTION_MODE | STATUS | FILE_STATUS | START_TIME | COMPLETION_TIME | ELAPSED_SECONDES | KEEP | KEEP_UNTIL | COMPRESSED | OUTPUT_BYTES | OUTPUT_RATE_BYTES | COMPRESSION_RATIO | OUTPUT_BYTES_DISPLAY | OUTPUT_RATE_BYTES_DISPLAY | TIME_TAKEN_DISPLAY |
+-------------+-----------+--------+---------+-------------+-----------------+---------+-------------+----------------------------+----------------------------+------------------+------+------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+
| 1 | 1 | 1 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-03 16:13:49.898310 | 2022-11-03 16:18:50.479716 | 301 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.581406 |
| 1 | 1 | 2 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-04 09:44:00.244071 | 2022-11-04 09:49:00.581360 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.337289 |
| 1 | 1 | 3 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-04 10:18:54.562517 | 2022-11-04 10:23:54.884979 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.322462 |
| 1 | 1 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:07.089446 | 45 | NO | | NO | 788821442 | 17704003.5703 | 0.55 | 752.28MB | 16.88MB/S | 00:00:44.556105 |
| 1 | 1 | 5 | 0 | I | NONE | DOING | COPYING | 1970-01-01 08:00:00.000000 | 1970-01-01 08:00:00.000000 | 0 | NO | | NO | 0 | NULL | NULL | 0.00MB | NULL | 00:00:00.000000 |
| 1 | 1001 | 1 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-03 16:13:49.898310 | 2022-11-03 16:18:50.396880 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.498570 |
| 1 | 1001 | 2 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-04 09:44:00.244071 | 2022-11-04 09:49:00.482836 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.238765 |
| 1 | 1001 | 3 | 0 | D | NONE | FAILED | INCOMPLETE | 2022-11-04 10:18:54.562517 | 2022-11-04 10:23:54.822612 | 300 | NO | | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.260095 |
| 1 | 1001 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:05.508469 | 43 | NO | | NO | 4945475 | 115077.6095 | 0.03 | 4.72MB | 0.11MB/S | 00:00:42.975128 |
| 1 | 1001 | 5 | 0 | I | NONE | DOING | COPYING | 1970-01-01 08:00:00.000000 | 1970-01-01 08:00:00.000000 | 0 | NO | | NO | 0 | NULL | NULL | 0.00MB | NULL | 00:00:00.000000 |
| 1 | 1002 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:06.015679 | 43 | NO | | NO | 4238019 | 97465.2973 | 0.07 | 4.04MB | 0.09MB/S | 00:00:43.482338 |
| 1 | 1002 | 5 | 0 | I | NONE | DOING | COPYING | 1970-01-01 08:00:00.000000 | 1970-01-01 08:00:00.000000 | 0 | NO | | NO | 0 | NULL | NULL | 0.00MB | NULL | 00:00:00.000000 |
| 1 | 1003 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:00.191137 | 38 | NO | | NO | 4242137 | 112649.6357 | 0.06 | 4.05MB | 0.11MB/S | 00:00:37.657796 |
| 1 | 1003 | 5 | 0 | I | NONE | DOING | COPYING | 1970-01-01 08:00:00.000000 | 1970-01-01 08:00:00.000000 | 0 | NO | | NO | 0 | NULL | NULL | 0.00MB | NULL | 00:00:00.000000 |
| 1 | 1004 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:00.621949 | 38 | NO | | NO | 4250330 | 111590.5837 | 0.06 | 4.05MB | 0.11MB/S | 00:00:38.088608 |
| 1 | 1004 | 5 | 0 | I | NONE | DOING | COPYING | 1970-01-01 08:00:00.000000 | 1970-01-01 08:00:00.000000 | 0 | NO | | NO | 0 | NULL | NULL | 0.00MB | NULL | 00:00:00.000000 |
| 1 | 1005 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:05.998997 | 43 | NO | | NO | 4944328 | 113752.5222 | 0.05 | 4.72MB | 0.11MB/S | 00:00:43.465656 |
| 1 | 1005 | 5 | 0 | I | NONE | DOING | COPYING | 1970-01-01 08:00:00.000000 | 1970-01-01 08:00:00.000000 | 0 | NO | | NO | 0 | NULL | NULL | 0.00MB | NULL | 00:00:00.000000 |
| 1 | 1006 | 4 | 0 | D | NONE | SUCCESS | AVAILABLE | 2023-05-05 16:22:22.533341 | 2023-05-05 16:23:06.823030 | 44 | NO | | NO | 766201153 | 17299763.6764 | 0.78 | 730.71MB | 16.50MB/S | 00:00:44.289689 |
| 1 | 1006 | 5 | 0 | I | NONE | DOING | COPYING | 1970-01-01 08:00:00.000000 | 1970-01-01 08:00:00.000000 | 0 | NO | | NO | 0 | NULL | NULL | 0.00MB | NULL | 00:00:00.000000 |
+-------------+-----------+--------+---------+-------------+-----------------+---------+-------------+----------------------------+----------------------------+------------------+------+------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+
20 rows in set (0.010 sec)
MySQL [oceanbase]> select * from cdb_ob_backup_piece_files;
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
| INCARNATION | TENANT_ID | ROUND_ID | BACKUP_PIECE_ID | COPY_ID | CREATE_DATE | START_TS | CHECKPOINT_TS | MAX_TS | STATUS | FILE_STATUS | COMPATIBLE | START_PIECE_ID |
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
| 1 | 1 | 1 | 0 | 0 | 20221103 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 2023-05-05 14:04:16.682178 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1 | 2 | 1 | 0 | 20230505 | 2023-05-05 14:20:58.585556 | | 2023-05-05 15:59:10.237749 | FROZEN | DELETED | 1 | 1 |
| 1 | 1 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:53:33.563736 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1001 | 1 | 0 | 0 | 20221103 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 2023-05-05 14:04:16.359674 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1001 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:53:33.563736 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1002 | 1 | 0 | 0 | 20221103 | 2022-12-14 12:31:47.330210 | | 2023-05-05 14:04:16.367860 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1002 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:53:33.563736 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1003 | 1 | 0 | 0 | 20221103 | 2022-12-14 12:49:47.280891 | 2023-04-23 15:00:48.794748 | 2023-05-05 14:04:16.422139 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1003 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:53:37.065240 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1004 | 1 | 0 | 0 | 20221103 | 2022-12-14 14:43:00.325092 | 2023-04-23 15:00:48.794748 | 2023-05-05 14:04:16.522301 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1004 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:53:37.065240 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1005 | 1 | 0 | 0 | 20221103 | 2023-03-17 14:39:11.551022 | 2023-04-17 14:06:32.471975 | 2023-05-05 14:04:16.622449 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1005 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:53:37.065240 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
| 1 | 1006 | 1 | 0 | 0 | 20221103 | 2023-04-18 10:22:14.398825 | | 2023-05-05 14:04:16.682178 | FROZEN | AVAILABLE | 1 | 0 |
| 1 | 1006 | 3 | 2 | 0 | 20230505 | 2023-05-05 16:00:01.015718 | 2023-05-05 16:53:33.563736 | MAX | ACTIVE | AVAILABLE | 1 | 2 |
+-------------+-----------+----------+-----------------+---------+-------------+----------------------------+----------------------------+----------------------------+--------+-------------+------------+----------------+
15 rows in set (0.042 sec)
備份集校驗
alter system validate database;
alter system validate backupset bakcup_set_id;
alter system validate backuppiece bakcup_set_id;
alter system validate database backup_dest='xxx';
檢視校驗結果:
MySQL [oceanbase]> select * from cdb_ob_backup_validation_job;
Empty set (0.002 sec)
MySQL [oceanbase]> select * from cdb_ob_tenant_backup_validation_task;
Empty set (0.002 sec)
==ocp備份:
叢集->備份恢復->備份恢復->新建備份策略
==關閉備份:
MySQL [oceanbase]> alter system cancel backup;
ERROR 9049 (HY000): backup status is stopped, can not cancel
MySQL [oceanbase]> alter system noarchivelog;
Query OK, 0 rows affected (0.110 sec)
==檢視備份任務:
root登入sys租戶
檢視備份進度
MySQL [(none)]> use oceanbase;
Database changed
MySQL [oceanbase]> desc cdb_ob_backup_progress;
+--------------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------------+--------------+------+-----+---------+-------+
| INCARNATION | bigint(20) | NO | | NULL | |
| BS_KEY | bigint(20) | NO | | NULL | |
| BACKUP_TYPE | varchar(1) | NO | | NULL | |
| TENANT_ID | bigint(20) | NO | | NULL | |
| PARTITION_COUNT | bigint(20) | YES | | NULL | |
| MACRO_BLOCK_COUNT | bigint(20) | NO | | NULL | |
| FINISH_PARTITION_COUNT | bigint(20) | YES | | NULL | |
| FINISH_MACRO_BLOCK_COUNT | bigint(20) | NO | | NULL | |
| INPUT_BYTES | bigint(20) | NO | | NULL | |
| OUTPUT_BYTES | bigint(20) | NO | | NULL | |
| START_TIME | timestamp(6) | NO | | NULL | |
| COMPLETION_TIME | timestamp(6) | NO | | NULL | |
| STATUS | varchar(9) | NO | | | |
+--------------------------+--------------+------+-----+---------+-------+
13 rows in set (0.002 sec)
MySQL [oceanbase]> select * from cdb_ob_backup_progress;
MySQL [oceanbase]> select * from cdb_ob_backup_set_details;
+-------------+-----------+--------+---------+-------------+-----------------+----------------------------+----------------------------+------------------+------+------------+-------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+--------+---------------------+----------+--------------+
| INCARNATION | TENANT_ID | BS_KEY | COPY_ID | BACKUP_TYPE | ENCRYPTION_MODE | START_TIME | COMPLETION_TIME | ELAPSED_SECONDES | KEEP | KEEP_UNTIL | DEVICE_TYPE | COMPRESSED | OUTPUT_BYTES | OUTPUT_RATE_BYTES | COMPRESSION_RATIO | OUTPUT_BYTES_DISPLAY | OUTPUT_RATE_BYTES_DISPLAY | TIME_TAKEN_DISPLAY | STATUS | START_REPLAY_LOG_TS | DATE | BACKUP_LEVEL |
+-------------+-----------+--------+---------+-------------+-----------------+----------------------------+----------------------------+------------------+------+------------+-------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+--------+---------------------+----------+--------------+
| 1 | 1 | 1 | 0 | D | NONE | 2022-11-03 16:13:49.898310 | 2022-11-03 16:18:50.479716 | 301 | NO | | FILE | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.581406 | FAILED | 0 | 20221103 | CLUSTER |
| 1 | 1 | 2 | 0 | D | NONE | 2022-11-04 09:44:00.244071 | 2022-11-04 09:49:00.581360 | 300 | NO | | FILE | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.337289 | FAILED | 0 | 20221104 | CLUSTER |
| 1 | 1 | 3 | 0 | D | NONE | 2022-11-04 10:18:54.562517 | 2022-11-04 10:23:54.884979 | 300 | NO | | FILE | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.322462 | FAILED | 0 | 20221104 | CLUSTER |
| 1 | 1001 | 1 | 0 | D | NONE | 2022-11-03 16:13:49.898310 | 2022-11-03 16:18:50.396880 | 300 | NO | | FILE | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.498570 | FAILED | 0 | 20221103 | CLUSTER |
| 1 | 1001 | 2 | 0 | D | NONE | 2022-11-04 09:44:00.244071 | 2022-11-04 09:49:00.482836 | 300 | NO | | FILE | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.238765 | FAILED | 0 | 20221104 | CLUSTER |
| 1 | 1001 | 3 | 0 | D | NONE | 2022-11-04 10:18:54.562517 | 2022-11-04 10:23:54.822612 | 300 | NO | | FILE | NO | 0 | 0.0000 | NULL | 0.00MB | 0.00MB/S | 00:05:00.260095 | FAILED | 0 | 20221104 | CLUSTER |
+-------------+-----------+--------+---------+-------------+-----------------+----------------------------+----------------------------+------------------+------+------------+-------------+------------+--------------+-------------------+-------------------+----------------------+---------------------------+--------------------+--------+---------------------+----------+--------------+
6 rows in set (0.005 sec)
檢視日誌備份:
MySQL [oceanbase]> select * from cdb_ob_backup_archivelog;
+-------------+-------------------+-----------+-------------+----------------+-----------------+----------------------------+----------------------------+-------------+--------------+-------------------+---------------------+----------------------+
| INCARNATION | LOG_ARCHIVE_ROUND | TENANT_ID | STATUS | START_PIECE_ID | BACKUP_PIECE_ID | MIN_FIRST_TIME | MAX_NEXT_TIME | INPUT_BYTES | OUTPUT_BYTES | COMPRESSION_RATIO | INPUT_BYTES_DISPLAY | OUTPUT_BYTES_DISPLAY |
+-------------+-------------------+-----------+-------------+----------------+-----------------+----------------------------+----------------------------+-------------+--------------+-------------------+---------------------+----------------------+
| 1 | 1 | 1 | INTERRUPTED | 0 | 0 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 1 | 1001 | INTERRUPTED | 0 | 0 | 2022-11-03 16:07:44.231998 | 2022-11-04 10:16:36.379290 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 1 | 1002 | INTERRUPTED | 0 | 0 | 2022-12-14 12:31:47.330210 | | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 1 | 1003 | INTERRUPTED | 0 | 0 | 2022-12-14 12:49:47.280891 | 2023-04-23 15:00:48.794748 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 1 | 1004 | INTERRUPTED | 0 | 0 | 2022-12-14 14:43:00.325092 | 2023-04-23 15:00:48.794748 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 1 | 1005 | INTERRUPTED | 0 | 0 | 2023-03-17 14:39:11.551022 | 2023-04-17 14:06:32.471975 | 0 | 0 | NULL | 0.00MB | 0.00MB |
| 1 | 1 | 1006 | INTERRUPTED | 0 | 0 | 2023-04-18 10:22:14.398825 | | 0 | 0 | NULL | 0.00MB | 0.00MB |
+-------------+-------------------+-----------+-------------+----------------+-----------------+----------------------------+----------------------------+-------------+--------------+-------------------+---------------------+----------------------+
檢視歷史備份自動清理記錄
MySQL [oceanbase]> desc cdb_ob_backup_clean_history;
+-------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+---------------+------+-----+---------+-------+
| TENANT_ID | bigint(20) | NO | | NULL | |
| BS_KEY | bigint(20) | NO | | NULL | |
| COPY_ID | bigint(20) | NO | | NULL | |
| START_TIME | timestamp(6) | NO | | NULL | |
| END_TIME | timestamp(6) | NO | | NULL | |
| INCARNATION | bigint(20) | NO | | NULL | |
| TYPE | varchar(64) | NO | | NULL | |
| STATUS | varchar(64) | NO | | NULL | |
| PARAMETER | varchar(256) | NO | | NULL | |
| ERROR_MSG | varchar(512) | NO | | NULL | |
| COMMENT | varchar(4096) | NO | | NULL | |
+-------------+---------------+------+-----+---------+-------+
11 rows in set (0.002 sec)
MySQL [oceanbase]> select * from cdb_ob_backup_clean_history;
Empty set (0.002 sec)
==ocp檢視任務,備份恢復->備份
======恢復
root登入sys租戶
obclient -h192.168.15.66 -P2883 -uroot@sys#Gaoyc:1667379307 '-pan~7&jtGcd|F43uoo*AOK' -A -D oceanbase
drop resource unit box_4c16g;
create resource unit box_4c16g max_cpu 4,max_memory 5368709120, max_iops 1000, max_disk_size 5368709120, max_session_num 64, min_cpu=4,min_memory=5368709120, min_iops=1000;
create resource unit box_test max_cpu=4,max_memory='5g', max_iops=1000, max_disk_size='10g', max_session_num=64, min_cpu=4,min_memory='5g', min_iops=1000;
--檢視資源單元配置[ocp登入後,左側租戶,單機unit規格管理]
select * from __all_unit_config;
MySQL [oceanbase]> create resource pool restore_pool unit='box_4c16g', unit_num=1, zone_list=('zone1','zone2','zone3');
ERROR 1235 (0A000): unit min memory less than __min_full_resource_pool_memory not supported [配置記憶體太小]
MySQL [oceanbase]> select * from __all_virtual_sys_parameter_stat where name like '%__min_full_resource_pool_memory%';
+-------+----------+--------------+----------+---------------------------------+-----------+------------+--------------+-------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | value_strict | info | need_reboot | section | visible_level | scope | source | edit_level |
+-------+----------+--------------+----------+---------------------------------+-----------+------------+--------------+-------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
| zone1 | observer | 192.168.15.66 | 2882 | __min_full_resource_pool_memory | NULL | 1073741824 | NULL | the min memory value which is specified for a full resource pool. | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | __min_full_resource_pool_memory | NULL | 1073741824 | NULL | the min memory value which is specified for a full resource pool. | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | __min_full_resource_pool_memory | NULL | 1073741824 | NULL | the min memory value which is specified for a full resource pool. | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+--------------+----------+---------------------------------+-----------+------------+--------------+-------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
3 rows in set (0.019 sec)
MySQL [oceanbase]> select * from __all_resource_pool;
+----------------------------+----------------------------+------------------+-----------------------------+------------+----------------+-------------------+-----------+--------------+--------------------+
| gmt_create | gmt_modified | resource_pool_id | name | unit_count | unit_config_id | zone_list | tenant_id | replica_type | is_tenant_sys_pool |
+----------------------------+----------------------------+------------------+-----------------------------+------------+----------------+-------------------+-----------+--------------+--------------------+
| 2022-11-03 15:47:24.262656 | 2022-11-03 15:47:24.267725 | 1 | sys_pool | 1 | 1 | zone1;zone2;zone3 | 1 | 0 | 0 |
| 2022-11-03 15:58:13.187736 | 2022-11-03 15:58:13.224635 | 1001 | pool_ORADB_zone3_mic | 1 | 1001 | zone3 | 1001 | 0 | 0 |
| 2022-11-03 15:58:13.195164 | 2022-11-03 15:58:13.224635 | 1002 | pool_ORADB_zone1_phu | 1 | 1002 | zone1 | 1001 | 0 | 0 |
| 2022-11-03 15:58:13.199381 | 2022-11-03 15:58:13.224635 | 1003 | pool_ORADB_zone2_vyt | 1 | 1003 | zone2 | 1001 | 0 | 0 |
| 2022-12-14 12:31:47.180931 | 2022-12-14 12:31:47.206069 | 1004 | pool_fsp_fsp001_zone2_his | 1 | 1004 | zone2 | 1002 | 0 | 0 |
| 2022-12-14 12:31:47.187176 | 2022-12-14 12:31:47.206069 | 1005 | pool_fsp_fsp001_zone3_eqt | 1 | 1006 | zone3 | 1002 | 0 | 0 |
| 2022-12-14 12:31:47.190342 | 2022-12-14 12:31:47.206069 | 1006 | pool_fsp_fsp001_zone1_tlq | 1 | 1005 | zone1 | 1002 | 0 | 0 |
| 2022-12-14 12:49:47.138722 | 2022-12-14 12:49:47.159856 | 1007 | pool_fsp_fsp002_zone3_njj | 1 | 1009 | zone3 | 1003 | 0 | 0 |
| 2022-12-14 12:49:47.142951 | 2022-12-14 12:49:47.159856 | 1008 | pool_fsp_fsp002_zone2_gni | 1 | 1007 | zone2 | 1003 | 0 | 0 |
| 2022-12-14 12:49:47.146119 | 2022-12-14 12:49:47.159856 | 1009 | pool_fsp_fsp002_zone1_tjn | 1 | 1008 | zone1 | 1003 | 0 | 0 |
| 2022-12-14 14:43:00.180972 | 2022-12-14 14:43:00.203017 | 1010 | pool_zncbtenant_zone1_ptl | 1 | 1012 | zone1 | 1004 | 0 | 0 |
| 2022-12-14 14:43:00.186215 | 2022-12-14 14:43:00.203017 | 1011 | pool_zncbtenant_zone2_cxw | 1 | 1010 | zone2 | 1004 | 0 | 0 |
| 2022-12-14 14:43:00.190433 | 2022-12-14 14:43:00.203017 | 1012 | pool_zncbtenant_zone3_yjc | 1 | 1011 | zone3 | 1004 | 0 | 0 |
| 2023-03-17 14:39:11.268786 | 2023-03-17 14:39:11.376977 | 1013 | pool_MYSDB_zone2_gvt | 1 | 1013 | zone2 | 1005 | 0 | 0 |
| 2023-03-17 14:39:11.275119 | 2023-03-17 14:39:11.376977 | 1014 | pool_MYSDB_zone3_ycq | 1 | 1014 | zone3 | 1005 | 0 | 0 |
| 2023-03-17 14:39:11.279335 | 2023-03-17 14:39:11.376977 | 1015 | pool_MYSDB_zone1_vjs | 1 | 1015 | zone1 | 1005 | 0 | 0 |
| 2023-04-18 10:22:14.239966 | 2023-04-18 10:22:14.272907 | 1016 | pool_sysbench_poc_zone2_dfm | 1 | 1016 | zone2 | 1006 | 0 | 0 |
| 2023-04-18 10:22:14.246599 | 2023-04-18 10:22:14.271852 | 1017 | pool_sysbench_poc_zone1_ccn | 1 | 1018 | zone1 | 1006 | 0 | 0 |
| 2023-04-18 10:22:14.249760 | 2023-04-18 10:22:14.272907 | 1018 | pool_sysbench_poc_zone3_djr | 1 | 1017 | zone3 | 1006 | 0 | 0 |
| 2023-05-06 15:01:55.720347 | 2023-05-06 15:01:55.720347 | 1019 | restore_pool | 1 | 1020 | zone1;zone2;zone3 | -1 | 0 | 0 |
+----------------------------+----------------------------+------------------+-----------------------------+------------+----------------+-------------------+-----------+--------------+--------------------+
20 rows in set (0.002 sec)
MySQL [oceanbase]> select * from __all_virtual_sys_parameter_stat where name like '%restore_idle%';;
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------+--------------------------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | value_strict | info | need_reboot | section | visible_level | scope | source | edit_level |
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------+--------------------------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
| zone1 | observer | 192.168.15.66 | 2882 | _restore_idle_time | NULL | 1m | NULL | the time interval between the schedules of physical restore task. Range: [10s, +∞) | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | _restore_idle_time | NULL | 1m | NULL | the time interval between the schedules of physical restore task. Range: [10s, +∞) | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | _restore_idle_time | NULL | 1m | NULL | the time interval between the schedules of physical restore task. Range: [10s, +∞) | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------+--------------------------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
3 rows in set (0.018 sec)
ERROR: No query specified
MySQL [oceanbase]> alter system set _restore_idle_time='10';
Query OK, 0 rows affected (0.041 sec)
MySQL [oceanbase]> select * from __all_virtual_sys_parameter_stat where name like '%restore_idle%';;
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------+--------------------------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | value_strict | info | need_reboot | section | visible_level | scope | source | edit_level |
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------+--------------------------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
| zone1 | observer | 192.168.15.66 | 2882 | _restore_idle_time | NULL | 10 | NULL | the time interval between the schedules of physical restore task. Range: [10s, +∞) | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | _restore_idle_time | NULL | 10 | NULL | the time interval between the schedules of physical restore task. Range: [10s, +∞) | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | _restore_idle_time | NULL | 10 | NULL | the time interval between the schedules of physical restore task. Range: [10s, +∞) | NULL | LOAD_BALANCE | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+--------------+----------+--------------------+-----------+-------+--------------+--------------------------------------------------------------------------------------+-------------+--------------+---------------+---------+---------+-------------------+
3 rows in set (0.021 sec)
ERROR: No query specified
MySQL [oceanbase]> select * from __all_virtual_sys_parameter_stat where name like '%restore_concurrency%';;
+-------+----------+--------------+----------+-------------------------+-----------+-------+--------------+-------------------------------------------------------------------------------+-------------+----------+---------------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | value_strict | info | need_reboot | section | visible_level | scope | source | edit_level |
+-------+----------+--------------+----------+-------------------------+-----------+-------+--------------+-------------------------------------------------------------------------------+-------------+----------+---------------+---------+---------+-------------------+
| zone1 | observer | 192.168.15.66 | 2882 | log_restore_concurrency | NULL | 10 | NULL | concurrency for log restoringRange: [1, ] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | 192.168.15.66 | 2882 | restore_concurrency | NULL | 0 | NULL | the current work thread num of restore macro block. Range: [0,512] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | log_restore_concurrency | NULL | 10 | NULL | concurrency for log restoringRange: [1, ] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | restore_concurrency | NULL | 0 | NULL | the current work thread num of restore macro block. Range: [0,512] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | log_restore_concurrency | NULL | 10 | NULL | concurrency for log restoringRange: [1, ] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | restore_concurrency | NULL | 0 | NULL | the current work thread num of restore macro block. Range: [0,512] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+--------------+----------+-------------------------+-----------+-------+--------------+-------------------------------------------------------------------------------+-------------+----------+---------------+---------+---------+-------------------+
6 rows in set (0.017 sec)
ERROR: No query specified
MySQL [oceanbase]> alter system set restore_concurrency=10;
Query OK, 0 rows affected (0.045 sec)
MySQL [oceanbase]> select * from __all_virtual_sys_parameter_stat where name like '%restore_concurrency%';;
+-------+----------+--------------+----------+-------------------------+-----------+-------+--------------+-------------------------------------------------------------------------------+-------------+----------+---------------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | value_strict | info | need_reboot | section | visible_level | scope | source | edit_level |
+-------+----------+--------------+----------+-------------------------+-----------+-------+--------------+-------------------------------------------------------------------------------+-------------+----------+---------------+---------+---------+-------------------+
| zone1 | observer | 192.168.15.66 | 2882 | log_restore_concurrency | NULL | 10 | NULL | concurrency for log restoringRange: [1, ] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | 192.168.15.66 | 2882 | restore_concurrency | NULL | 10 | NULL | the current work thread num of restore macro block. Range: [0,512] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | log_restore_concurrency | NULL | 10 | NULL | concurrency for log restoringRange: [1, ] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | 192.168.15.67 | 2882 | restore_concurrency | NULL | 0 | NULL | the current work thread num of restore macro block. Range: [0,512] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | log_restore_concurrency | NULL | 10 | NULL | concurrency for log restoringRange: [1, ] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | 192.168.15.68 | 2882 | restore_concurrency | NULL | 10 | NULL | the current work thread num of restore macro block. Range: [0,512] in integer | NULL | OBSERVER | NULL | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+--------------+----------+-------------------------+-----------+-------+--------------+-------------------------------------------------------------------------------+-------------+----------+---------------+---------+---------+-------------------+
6 rows in set (0.019 sec)
ERROR: No query specified
====正式恢復,恢復租戶的密碼繼承備份租戶的密碼
root登入sys租戶
檢視原租戶內容:
mysql -h192.168.15.66 -P2883 -uroot@sysbench_poc#Gaoyc:1667379307 -p'an~7&jtGcd|F43uoo*AOK' -d test
MySQL [test]> select count(*) from sbtest59;
+----------+
| count(*) |
+----------+
| 168579 |
+----------+
1 row in set (0.05 sec)
MySQL [test]> select count(*) from sbtest7;
+----------+
| count(*) |
+----------+
| 168665 |
+----------+
1 row in set (0.06 sec)
MySQL [test]> select count(*) from sbtest17;
+----------+
| count(*) |
+----------+
| 168994 |
+----------+
1 row in set (0.17 sec)
恢復表:
ALTER SYSTEM RESTORE <table_name_list> FOR <dest_tenant_name> FROM <source_tenant_name> AT 'file:///nfsbackup/gaoyc' UNTIL '2023-05-06 08:59:45' WITH 'backup_cluster_name=Gaoyc&backup_cluster_id=1667379307&pool_list=restore_pool';
MySQL [oceanbase]> ALTER SYSTEM RESTORE test.sbtest59, test.sbtest7, test.sbtest17 FOR restore_sysbentch_tables FROM sysbench_poc AT 'file:///nfsbackup/gaoyc' UNTIL '2023-05-06 08:59:45' WITH 'backup_cluster_name=Gaoyc&backup_cluster_id=1667379307&pool_list=restore_pool';
Query OK, 0 rows affected (0.019 sec)
MySQL [oceanbase]> select * from cdb_ob_restore_progress;
+--------+-----------------+-----------+--------------------------+------------------+--------------------+-------------------+---------------------+------------------------------------------------------+---------------------+----------------------------+-----------------+-----------------+-------------------+------------------------+--------------------------+----------------------------+----------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+------+
| JOB_ID | EXTERNAL_JOB_ID | TENANT_ID | TENANT_NAME | BACKUP_TENANT_ID | BACKUP_TENANT_NAME | BACKUP_CLUSTER_ID | BACKUP_CLUSTER_NAME | WHITE_LIST | STATUS | START_TIME | COMPLETION_TIME | PARTITION_COUNT | MACRO_BLOCK_COUNT | FINISH_PARTITION_COUNT | FINISH_MACRO_BLOCK_COUNT | RESTORE_START_TIMESTAMP | RESTORE_FINISH_TIMESTAMP | RESTORE_CURRENT_TIMESTAMP | BACKUP_SET_LIST | BACKUP_PIECE_LIST | INFO |
+--------+-----------------+-----------+--------------------------+------------------+--------------------+-------------------+---------------------+------------------------------------------------------+---------------------+----------------------------+-----------------+-----------------+-------------------+------------------------+--------------------------+----------------------------+----------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+------+
| 8 | -1 | 1010 | restore_sysbentch_tables | 1006 | sysbench_poc | 1667379307 | Gaoyc | `test`.`sbtest59`,`test`.`sbtest7`,`test`.`sbtest17` | RESTORE_SYS_REPLICA | 2023-05-08 11:10:07.024407 | NULL | 149 | -1 | 23 | -1 | 2023-05-05 16:56:13.410287 | 2023-05-06 08:59:45.000000 | NULL | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_4_full_20230505,file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_5_inc_20230505 | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/clog/3_2_20230505 | |
+--------+-----------------+-----------+--------------------------+------------------+--------------------+-------------------+---------------------+------------------------------------------------------+---------------------+----------------------------+-----------------+-----------------+-------------------+------------------------+--------------------------+----------------------------+----------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+------+
1 row in set (0.001 sec)
MySQL [oceanbase]> select * from cdb_ob_restore_history;
+--------+-----------------+-----------+--------------------------+------------------+--------------------+-------------------+---------------------+------------------------------------------------------+-----------------+----------------------------+----------------------------+-----------------+-------------------+------------------------+--------------------------+----------------------------+----------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| JOB_ID | EXTERNAL_JOB_ID | TENANT_ID | TENANT_NAME | BACKUP_TENANT_ID | BACKUP_TENANT_NAME | BACKUP_CLUSTER_ID | BACKUP_CLUSTER_NAME | WHITE_LIST | STATUS | START_TIME | COMPLETION_TIME | PARTITION_COUNT | MACRO_BLOCK_COUNT | FINISH_PARTITION_COUNT | FINISH_MACRO_BLOCK_COUNT | RESTORE_START_TIMESTAMP | RESTORE_FINISH_TIMESTAMP | RESTORE_CURRENT_TIMESTAMP | BACKUP_SET_LIST | BACKUP_PIECE_LIST | INFO |
+--------+-----------------+-----------+--------------------------+------------------+--------------------+-------------------+---------------------+------------------------------------------------------+-----------------+----------------------------+----------------------------+-----------------+-------------------+------------------------+--------------------------+----------------------------+----------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
| 4 | -1 | 0 | restore_tenant | 0 | sysbench_poc | 1667379307 | Gaoyc | `test`.`sbtest59`,`test`.`sbtest7`,`test`.`sbtest17` | RESTORE_FAIL | 2023-05-06 16:45:16.945700 | 2023-05-06 16:45:17.390029 | -1 | -1 | -1 | -1 | NULL | 2023-05-06 08:59:45.000000 | NULL | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_4_full_20230505,file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_5_inc_20230505 | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/clog/3_2_20230505 | ROOTSERVICE : OB_RESOURCE_POOL_ALREADY_GRANTED(-4626) on "192.168.15.66:2882" with traceid YB420A33AF42-0005FA0EC3B1D708-0-0 |
| 5 | -1 | 0 | restore_tenant | 0 | sysbench_poc | 1667379307 | Gaoyc | `test`.`sbtest59`,`test`.`sbtest7`,`test`.`sbtest17` | RESTORE_FAIL | 2023-05-06 16:53:08.981346 | 2023-05-06 16:53:09.392656 | -1 | -1 | -1 | -1 | NULL | 2023-05-06 08:59:45.000000 | NULL | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_4_full_20230505,file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_5_inc_20230505 | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/clog/3_2_20230505 | ROOTSERVICE : OB_RESOURCE_POOL_ALREADY_GRANTED(-4626) on "192.168.15.66:2882" with traceid YB420A33AF42-0005FA0EC3B1D739-0-0 |
| 7 | -1 | 0 | restore_sysbentch | 0 | sysbench_poc | 1667379307 | Gaoyc | | RESTORE_FAIL | 2023-05-08 10:54:49.359723 | 2023-05-08 10:54:49.892190 | -1 | -1 | -1 | -1 | NULL | 2023-05-06 08:59:45.000000 | NULL | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_4_full_20230505,file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_5_inc_20230505 | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/clog/3_2_20230505 | ROOTSERVICE : OB_RESOURCE_POOL_ALREADY_GRANTED(-4626) on "192.168.15.66:2882" with traceid YB420A33AF42-0005FA0EC3B21253-0-0 |
| 8 | -1 | 1010 | restore_sysbentch_tables | 1006 | sysbench_poc | 1667379307 | Gaoyc | `test`.`sbtest59`,`test`.`sbtest7`,`test`.`sbtest17` | RESTORE_SUCCESS | 2023-05-08 11:10:07.024407 | 2023-05-08 11:13:15.173922 | 3 | -1 | 3 | -1 | 2023-05-05 16:56:13.410287 | 2023-05-06 08:59:45.000000 | NULL | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_4_full_20230505,file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/data/backup_set_5_inc_20230505 | file:///nfsbackup/gaoyc/Gaoyc/1667379307/incarnation_1/1006/clog/3_2_20230505 | |
+--------+-----------------+-----------+--------------------------+------------------+--------------------+-------------------+---------------------+------------------------------------------------------+-----------------+----------------------------+----------------------------+-----------------+-------------------+------------------------+--------------------------+----------------------------+----------------------------+---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+
4 row in set (0.042 sec)
【問題說明:1】
ROOTSERVICE : OB_RESOURCE_POOL_ALREADY_GRANTED(-4626) on "192.168.15.66:2882" with traceid YB420A33AF42-0005FA0EC3B21253-0-0
可以從官檔中檢視錯誤程式碼 4626
錯誤原因為資源池已有租戶在使用,使用新建立的資源池即可。
恢復租戶:
ALTER SYSTEM RESTORE <dest_tenant_name> FROM <source_tenant_name> at 'uri' UNTIL 'timestamp' WITH 'restore_option';
create resource pool restore_pool_tenant unit='box_4c16g', unit_num=1, zone_list=('zone1','zone2','zone3');
ALTER SYSTEM RESTORE restore_sysbentch FROM sysbench_poc AT 'file:///nfsbackup/gaoyc' UNTIL '2023-05-06 08:59:45' WITH 'backup_cluster_name=Gaoyc&backup_cluster_id=1667379307&pool_list=restore_pool_tenant';
原租戶登入:
mysql -h192.168.15.66 -P2883 -uroot@sysbench_poc#Gaoyc:1667379307 -p'an~7&jtGcd|F43uoo*AOK'
恢復租戶登入:
mysql -h192.168.15.66 -P2883 -uroot@restore_sysbentch_tables#Gaoyc:1667379307 -p'an~7&jtGcd|F43uoo*AOK'
mysql -h192.168.15.66 -P2883 -uroot@restore_sysbentch#Gaoyc:1667379307 -p'an~7&jtGcd|F43uoo*AOK'
注:生產上的操作請經過嚴格測試。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24585765/viewspace-2952610/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL備份與恢復——基於Xtrabackup物理備份恢復MySql
- Mysql備份與恢復(1)---物理備份MySql
- MySQL 非常規恢復與物理備份恢復MySql
- 詳解叢集級備份恢復:物理細粒度備份恢復
- OceanBase-OB備份異地恢復流程
- 物理冷備份與恢復的操作命令
- k8s備份恢復實踐--veleroK8S
- 達夢DM備份恢復(物理和邏輯)
- RAC備份恢復之Voting備份與恢復
- Kubernetes的備份和恢復最佳實踐是什麼
- MySQL備份與恢復——實操MySql
- 備份與恢復:polardb資料庫備份與恢復資料庫
- 阿里雲RDS物理備份恢復至本地伺服器8.0阿里伺服器
- 備份和恢復
- mydumper備份恢復
- Mysql備份恢復MySql
- Kubernetes備份恢復之velero實戰
- MySQL備份與恢復——基於MyDumper/MyLoader 邏輯備份恢復MySql
- MySQL 備份與恢復MySql
- redis 備份和恢復Redis
- RMAN備份恢復技巧
- Jenkins備份與恢復Jenkins
- KunlunDB備份和恢復
- Grafana 備份恢復教程Grafana
- rman 增量備份恢復
- Postgresql 備份與恢復SQL
- MySQL備份與恢復——基於OUTFILE /LOAD DATA 邏輯備份恢復MySql
- 【PG備份恢復】pg_basebackup 多表空間備份恢復測試
- Active Directory 恢復與備份最佳實操
- Mysql備份與恢復(2)---邏輯備份MySql
- GitLab的備份與恢復Gitlab
- 資料庫備份恢復資料庫
- DB的備份與恢復
- ORACLE備份&恢復案例(轉)Oracle
- RMAN備份異機恢復
- tore 命令來恢復備份
- SqlServer備份和恢復(二)SQLServer
- Oracle 備份 與 恢復 概述Oracle