diff --git a/media/sqlgram/BRIETables.png b/media/sqlgram/BRIETables.png deleted file mode 100644 index e460994bfdc00..0000000000000 Binary files a/media/sqlgram/BRIETables.png and /dev/null differ diff --git a/media/sqlgram/BackupOption.png b/media/sqlgram/BackupOption.png deleted file mode 100644 index 4425d81c996e0..0000000000000 Binary files a/media/sqlgram/BackupOption.png and /dev/null differ diff --git a/media/sqlgram/BackupStmt.png b/media/sqlgram/BackupStmt.png deleted file mode 100644 index 5ffa691835a7d..0000000000000 Binary files a/media/sqlgram/BackupStmt.png and /dev/null differ diff --git a/media/sqlgram/BackupTSO.png b/media/sqlgram/BackupTSO.png deleted file mode 100644 index 29ea0bf28a549..0000000000000 Binary files a/media/sqlgram/BackupTSO.png and /dev/null differ diff --git a/media/sqlgram/Boolean.png b/media/sqlgram/Boolean.png deleted file mode 100644 index b44f358d666e9..0000000000000 Binary files a/media/sqlgram/Boolean.png and /dev/null differ diff --git a/media/sqlgram/RestoreOption.png b/media/sqlgram/RestoreOption.png deleted file mode 100644 index 8ff807478df15..0000000000000 Binary files a/media/sqlgram/RestoreOption.png and /dev/null differ diff --git a/media/sqlgram/RestoreStmt.png b/media/sqlgram/RestoreStmt.png deleted file mode 100644 index 7fae5bc1152b7..0000000000000 Binary files a/media/sqlgram/RestoreStmt.png and /dev/null differ diff --git a/media/sqlgram/ShowBRIEStmt.png b/media/sqlgram/ShowBRIEStmt.png deleted file mode 100644 index 651e03a67802b..0000000000000 Binary files a/media/sqlgram/ShowBRIEStmt.png and /dev/null differ diff --git a/sql-statements/sql-statement-backup.md b/sql-statements/sql-statement-backup.md index 39eb68d13e3e6..374c957a90bf4 100644 --- a/sql-statements/sql-statement-backup.md +++ b/sql-statements/sql-statement-backup.md @@ -20,25 +20,28 @@ Only one `BACKUP` and [`RESTORE`](/sql-statements/sql-statement-restore.md) task ## Synopsis -**BackupStmt:** - -![BackupStmt](/media/sqlgram/BackupStmt.png) - -**BRIETables:** - -![BRIETables](/media/sqlgram/BRIETables.png) - -**BackupOption:** - -![BackupOption](/media/sqlgram/BackupOption.png) - -**Boolean:** - -![Boolean](/media/sqlgram/Boolean.png) - -**BackupTSO:** - -![BackupTSO](/media/sqlgram/BackupTSO.png) +```ebnf+diagram +BackupStmt ::= + "BACKUP" BRIETables "TO" stringLit BackupOption* + +BRIETables ::= + "DATABASE" ( '*' | DBName (',' DBName)* ) +| "TABLE" TableNameList + +BackupOption ::= + "RATE_LIMIT" '='? LengthNum "MB" '/' "SECOND" +| "CONCURRENCY" '='? LengthNum +| "CHECKSUM" '='? Boolean +| "SEND_CREDENTIALS_TO_TIKV" '='? Boolean +| "LAST_BACKUP" '='? BackupTSO +| "SNAPSHOT" '='? ( BackupTSO | LengthNum TimestampUnit "AGO" ) + +Boolean ::= + NUM | "TRUE" | "FALSE" + +BackupTSO ::= + LengthNum | stringLit +``` ## Examples diff --git a/sql-statements/sql-statement-restore.md b/sql-statements/sql-statement-restore.md index e1bbe451f528d..bcb98e6b14c21 100644 --- a/sql-statements/sql-statement-restore.md +++ b/sql-statements/sql-statement-restore.md @@ -14,9 +14,9 @@ The `RESTORE` statement uses the same engine as the [BR tool](/br/backup-and-res * When a full restore is being performed, the tables being restored should not already exist, because existing data might be overridden and causes inconsistency between the data and indices. * When an incremental restore is being performed, the tables should be at the exact same state as the `LAST_BACKUP` timestamp when the backup is created. -Running `RESTORE` requires `SUPER` privilege. Additionally, both the TiDB node executing the backup and all TiKV nodes in the cluster must have read permission from the destination. +Running `RESTORE` requires `SUPER` privilege. Additionally, both the TiDB node executing the restore and all TiKV nodes in the cluster must have read permission from the destination. -The `RESTORE` statement is blocking, and will finish only after the entire backup task is finished, failed, or canceled. A long-lasting connection should be prepared for running `RESTORE`. The task can be canceled using the [`KILL TIDB QUERY`](/sql-statements/sql-statement-kill.md) statement. +The `RESTORE` statement is blocking, and will finish only after the entire restore task is finished, failed, or canceled. A long-lasting connection should be prepared for running `RESTORE`. The task can be canceled using the [`KILL TIDB QUERY`](/sql-statements/sql-statement-kill.md) statement. Only one `BACKUP` and `RESTORE` task can be executed at a time. If a `BACKUP` or `RESTORE` task is already running on the same TiDB server, the new `RESTORE` execution will wait until all previous tasks are done. @@ -24,21 +24,23 @@ Only one `BACKUP` and `RESTORE` task can be executed at a time. If a `BACKUP` or ## Synopsis -**RestoreStmt:** +```ebnf+diagram +RestoreStmt ::= + "RESTORE" BRIETables "FROM" stringLit RestoreOption* -![RestoreStmt](/media/sqlgram/RestoreStmt.png) +BRIETables ::= + "DATABASE" ( '*' | DBName (',' DBName)* ) +| "TABLE" TableNameList -**BRIETables:** +RestoreOption ::= + "RATE_LIMIT" '='? LengthNum "MB" '/' "SECOND" +| "CONCURRENCY" '='? LengthNum +| "CHECKSUM" '='? Boolean +| "SEND_CREDENTIALS_TO_TIKV" '='? Boolean -![BRIETables](/media/sqlgram/BRIETables.png) - -**RestoreOption:** - -![RestoreOption](/media/sqlgram/RestoreOption.png) - -**Boolean:** - -![Boolean](/media/sqlgram/Boolean.png) +Boolean ::= + NUM | "TRUE" | "FALSE" +``` ## Examples diff --git a/sql-statements/sql-statement-show-backups.md b/sql-statements/sql-statement-show-backups.md index 4d87692c2c800..0dba2fdee54b8 100644 --- a/sql-statements/sql-statement-show-backups.md +++ b/sql-statements/sql-statement-show-backups.md @@ -12,13 +12,14 @@ Use `SHOW BACKUPS` to query `BACKUP` tasks and use `SHOW RESTORES` to query `RES ## Synopsis -**ShowBRIEStmt:** +```ebnf+diagram +ShowBRIEStmt ::= + "SHOW" ("BACKUPS" | "RESTORES") ShowLikeOrWhere? -![ShowBRIEStmt](/media/sqlgram/ShowBRIEStmt.png) - -**ShowLikeOrWhereOpt:** - -![ShowLikeOrWhereOpt](/media/sqlgram/ShowLikeOrWhereOpt.png) +ShowLikeOrWhere ::= + "LIKE" SimpleExpr +| "WHERE" Expression +``` ## Examples