-
Notifications
You must be signed in to change notification settings - Fork 1.2k
sql-statements: BR / PITR SQL enhancement #13663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/cc @YuJuncen |
/cc @qiancai |
/cc @benmaoer |
Signed-off-by: BornChanger <[email protected]>
d7240cd
to
b6dbf74
Compare
--- | ||
title: TiDB 日志备份与 PITR 语句 | ||
summary: 介绍 TiDB 日志备份与 PITR 的 SQL 语句。 | ||
aliases: ['/zh/tidb/dev/br-log-statement/'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aliases: ['/zh/tidb/dev/br-log-statement/'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新文档不需要 aliases,aliases 用于添加被删除的文档的别名
{{< copyable "sql" >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< copyable "sql" >}} |
{{< copyable "sql" >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< copyable "sql" >}} |
{{< copyable "sql" >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< copyable "sql" >}} |
{{< copyable "sql" >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< copyable "sql" >}} |
{{< copyable "sql" >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< copyable "sql" >}} |
{{< copyable "sql" >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< copyable "sql" >}} |
{{< copyable "sql" >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< copyable "sql" >}} |
{{< copyable "sql" >}} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{{< copyable "sql" >}} |
summary: TiDB 数据库中 BR 作业管理语句的使用概况。 | ||
aliases: ['/docs-cn/dev/sql-statements/sql-statement-br-job-admin'] | ||
--- | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
缺少一级标题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHOW BR JOB [QUERY] 和 CANCEL BR JOB
+----------+------------+-----------+-------------+---------------------+---------------------+ | ||
| Database | Table | Total_kvs | Total_bytes | Time_range_start | Time_range_end | | ||
+----------+------------+-----------+-------------+---------------------+---------------------+ | ||
| tpcc | warehouse | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
| tpcc | district | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
| tpcc | stock | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
| tpcc | orders | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
| tpcc | customer | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
| tpcc | new_order | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
| tpcc | item | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
| tpcc | history | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
| tpcc | order_line | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | ||
+----------+------------+-----------+-------------+---------------------+---------------------+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+----------+------------+-----------+-------------+---------------------+---------------------+ | |
| Database | Table | Total_kvs | Total_bytes | Time_range_start | Time_range_end | | |
+----------+------------+-----------+-------------+---------------------+---------------------+ | |
| tpcc | warehouse | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
| tpcc | district | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
| tpcc | stock | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
| tpcc | orders | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
| tpcc | customer | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
| tpcc | new_order | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
| tpcc | item | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
| tpcc | history | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
| tpcc | order_line | 0 | 0 | 1970-01-01 08:00:00 | 2023-04-10 11:18:21 | | |
+----------+------------+-----------+-------------+---------------------+---------------------+ | |
+----------+------------+-----------+-------------+------------------+---------------------+ | |
| Database | Table | Total_kvs | Total_bytes | Time_range_start | Time_range_end | | |
+----------+------------+-----------+-------------+------------------+---------------------+ | |
| tpcc | history | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
| tpcc | district | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
| tpcc | new_order | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
| tpcc | orders | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
| tpcc | order_line | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
| tpcc | customer | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
| tpcc | stock | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
| tpcc | warehouse | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
| tpcc | item | 0 | 0 | <null> | 2023-04-10 11:18:21 | | |
+----------+------------+-----------+-------------+------------------+---------------------+ |
I have made a change, which returns <nil>
for full backups.
|
||
本文介绍 TiDB BR (BACKUP & RESTORE) 作业管理语句,包括下面几种语句: | ||
```sql | ||
SHOW BR JOB --show information of a br task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admin show br job 还是 show br job ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admin show br job
```sql | ||
SHOW BR JOB --show information of a br task | ||
SHOW BR JOB QUERY --show the query statement of a br task | ||
CANCEL BR JOB --cancel a br task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
admin cancel br job
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DDL 的 CANCEL 时使用 CANCEL DDL JOBS
关键字,是否和 DDL 保持一致
ADMIN CANCEL DDL JOBS job_id [, job_id] ...;
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
{{< copyable "sql" >}} | ||
|
||
```sql | ||
SHOW BR JOB 13456; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SHOW BR JOB 13456; | |
SHOW BR JOBS where job_id = 13456; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 100 是分页展示历史
SQL> SHOW BR JOBS 100;
-- 100 是 job_id
SQL> SHOW BR JOBS where job_id = 100;
-- 展示原始执行的 SQL 语句
SQL> SHOW BR JOB QUERIES 58;
{{< copyable "sql" >}} | ||
|
||
```sql | ||
SHOW BR JOB QUERY 13456; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议添加上 SHOW BR JOB QUERIES where job_id = 13456 的返回结果
```sql | ||
SHOW BR JOB --show information of a br task | ||
SHOW BR JOB QUERY --show the query statement of a br task | ||
CANCEL BR JOB --cancel a br task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CANCEL BR JOB --cancel a br task | |
CANCEL BR JOBS --cancel br tasks |
@BornChanger: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
First-time contributors' checklist
What is changed, added or deleted? (Required)
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions (in Chinese).
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?