From 4d638dec3be5e9e2af9339de48c3e9e347702787 Mon Sep 17 00:00:00 2001 From: Aolin Date: Sat, 7 Oct 2023 11:33:23 +0800 Subject: [PATCH] docs: add --with-sys-table detail description (#14919) --- br/br-snapshot-guide.md | 25 ++++++++++++++++++++++++- br/br-snapshot-manual.md | 2 ++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/br/br-snapshot-guide.md b/br/br-snapshot-guide.md index b26c36e7085e7..7d9152b1f9751 100644 --- a/br/br-snapshot-guide.md +++ b/br/br-snapshot-guide.md @@ -135,15 +135,38 @@ Starting from BR v5.1.0, when you back up snapshots, BR backs up the **system ta | mysql.role_edges | | mysql.tables_priv | | mysql.user | +| mysql.bind_info | +----------------------------------+ ``` **BR does not restore the following system tables:** -- Statistics tables (`mysql.stats_*`) +- Statistics tables (`mysql.stat_*`) - System variable tables (`mysql.tidb` and `mysql.global_variables`) - [Other system tables](https://github.com/pingcap/tidb/blob/master/br/pkg/restore/systable_restore.go#L31) +``` ++-----------------------------------------------------+ +| capture_plan_baselines_blacklist | +| column_stats_usage | +| gc_delete_range | +| gc_delete_range_done | +| global_variables | +| schema_index_usage | +| stats_buckets | +| stats_extended | +| stats_feedback | +| stats_fm_sketch | +| stats_histograms | +| stats_history | +| stats_meta | +| stats_meta_history | +| stats_table_locked | +| stats_top_n | +| tidb | ++-----------------------------------------------------+ +``` + When you restore data related to system privilege, note the following: - BR does not restore user data with `user` as `cloud_admin` and `host` as `'%'`. This user is reserved for TiDB Cloud. Do not create a user or role named `cloud_admin` in your cluster, because the user privileges related to `cloud_admin` cannot be restored correctly. diff --git a/br/br-snapshot-manual.md b/br/br-snapshot-manual.md index 1d6f19a74cfc0..78e79151aad83 100644 --- a/br/br-snapshot-manual.md +++ b/br/br-snapshot-manual.md @@ -145,6 +145,7 @@ You can restore a TiDB cluster snapshot by running the `br restore full` command ```shell br restore full \ --pd "${PD_IP}:2379" \ + --with-sys-table \ --storage "s3://${backup_collection_addr}/snapshot-${date}?access-key=${access-key}&secret-access-key=${secret-access-key}" \ --ratelimit 128 \ --log-file restorefull.log @@ -152,6 +153,7 @@ br restore full \ In the preceding command: +- `--with-sys-table`: BR restores **data in some system tables**, including account permission data and SQL bindings. However, it does not restore statistics tables (`mysql.stat_*`) and system variable tables (`mysql.tidb` and `mysql.global_variables`). For more information, see [Restore tables in the `mysql` schema](/br/br-snapshot-guide.md#restore-tables-in-the-mysql-schema). - `--ratelimit`: The maximum speed **per TiKV** performing backup tasks. The unit is in MiB/s. - `--log-file`: The target file where the `br` log is written.