You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: dm/dm-faq.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -188,7 +188,7 @@ if the DDL is not needed, you can use a filter rule with \"*\" schema-pattern to
188
188
189
189
The reason for this type of error is that the TiDB parser cannot parse DDL statements sent by the upstream, such as `ALTER EVENT`, so `sql-skip` does not take effect as expected. You can add [binlog event filters](/dm/dm-key-features.md#binlog-event-filter) in the configuration file to filter those statements and set `schema-pattern: "*"`. Starting from DM v2.0.1, DM pre-filters statements related to `EVENT`.
190
190
191
-
Since DM v2.0, `handle-error` replaces `sql-skip`. You can use `handle-error` instead to avoid this issue.
191
+
Since DM v6.0, `binlog` replaces `sql-skip` and `handle-error`. You can use the `binlog` command instead to avoid this issue.
192
192
193
193
## Why do `REPLACE` statements keep appearing in the downstream when DM is replicating?
194
194
@@ -368,7 +368,7 @@ In this case, you can check the environment variable `https_proxy` (note that it
368
368
To solve this issue, check whether `https_proxy` is mandatory. If not, cancel the setting. Otherwise, add the environment variable setting `https_proxy="" ./dmctl --master-addr "x.x.x.x:8261"` before the oringial dmctl commands.
369
369
370
370
> **Note:**
371
-
>
371
+
>
372
372
> The environment variables related to `proxy` include `http_proxy`, `https_proxy`, and `no_proxy`. If the connection error persists after you perform the above steps, check whether the configuration parameters of `http_proxy` and `no_proxy` are correct.
373
373
374
374
## How to handle the returned error when executing start-relay command for DM versions from 2.0.2 to 2.0.6?
Copy file name to clipboardexpand all lines: dm/dm-manage-schema.md
+88-37
Original file line number
Diff line number
Diff line change
@@ -30,76 +30,83 @@ However, during the migration with [optimistic mode sharding DDL support](/dm/fe
30
30
31
31
In addition, in some scenarios (such as when the downstream table has more columns than the upstream table), `schema-D` might be inconsistent with `schema-B` and `schema-I`.
32
32
33
-
To support the scenarios mentioned above and handle other migration interruptions caused by schema inconsistency, DM provides the `operate-schema` command to obtain, modify, and delete the `schema-I` table schema maintained in DM.
33
+
To support the scenarios mentioned above and handle other migration interruptions caused by schema inconsistency, DM provides the `binlog-schema` command to obtain, modify, and delete the `schema-I` table schema maintained in DM.
34
+
35
+
> **Note:**
36
+
>
37
+
> The `binlog-schema` command is supported only in DM v6.0 or later versions. For earlier versions, you must use the `operate-schema` command.
34
38
35
39
## Command
36
40
37
41
{{< copyable "shell-regular" >}}
38
42
39
43
```bash
40
-
helpoperate-schema
44
+
helpbinlog-schema
41
45
```
42
46
43
47
```
44
-
`get`/`set`/`remove` the schema for an upstream table.
--flush flush the table info and checkpoint immediately
52
-
-h, --help help for operate-schema
53
-
--sync sync the table info to master to resolve shard ddl lock, only for optimistic mode now
54
-
-t, --table string table name
59
+
-h, --help help for binlog-schema
55
60
56
61
Global Flags:
57
62
-s, --source strings MySQL Source ID.
63
+
64
+
Use "dmctl binlog-schema [command] --help" for more information about a command.
58
65
```
59
66
60
67
> **Note:**
61
68
>
62
-
> - Because a table schema might change during data migration, to obtain a predictable table schema, currently the `operate-schema` command can be used only when the data migration task is in the `Paused` state.
69
+
> - Because a table schema might change during data migration, to obtain a predictable table schema, currently the `binlog-schema` command can be used only when the data migration task is in the `Paused` state.
63
70
> - To avoid data loss due to mishandling, it is **strongly recommended** to get and backup the table schema firstly before you modify the schema.
64
71
65
72
## Parameters
66
73
67
-
*`operate-type`:
68
-
- Required.
69
-
- Specifies the type of operation on the schema. The optional values are `get`, `set`, and `remove`.
70
-
*`-s`:
74
+
*`delete`: Deletes the table schema.
75
+
*`list`: Lists the table schema.
76
+
*`update`: Updates the table schema.
77
+
*`-s` or `--source`:
71
78
- Required.
72
79
- Specifies the MySQL source that the operation is applied to.
73
-
*`task-name | task-file`:
74
-
- Required.
75
-
- Specifies the task name or task file path.
76
-
*`-d`:
77
-
- Required.
78
-
- Specifies the name of the upstream database the table belongs to.
79
-
*`-t`:
80
-
- Required.
81
-
- Specifies the name of the upstream table corresponding to the table.
82
-
*`schema-file`:
83
-
- Required when the operation type is `set`. Optional for other operation types.
84
-
- The table schema file to be set. The file content should be a valid `CREATE TABLE` statement.
85
-
*`--flush`:
86
-
- Optional.
87
-
- Writes the schema to the checkpoint so that DM can load it after restarting the task.
88
-
- The default value is `true`.
89
-
*`--sync`:
90
-
- Optional. Only used when an error occurs in the optimistic sharding DDL mode.
91
-
- Updates the optimistic sharding metadata with this schema.
92
80
93
81
## Usage example
94
82
95
83
### Get the table schema
96
84
85
+
To get the table schema, run the `binlog-schema list` command:
86
+
87
+
```bash
88
+
help binlog-schema list
89
+
```
90
+
91
+
```
92
+
show table schema structure
93
+
94
+
Usage:
95
+
dmctl binlog-schema list <task-name> <database> <table> [flags]
96
+
97
+
Flags:
98
+
-h, --help help for list
99
+
100
+
Global Flags:
101
+
-s, --source strings MySQL Source ID.
102
+
```
103
+
97
104
If you want to get the table schema of the ``` `db_single`.`t1` ``` table corresponding to the `mysql-replica-01` MySQL source in the `db_single` task, run the following command:
98
105
99
106
{{< copyable "shell-regular" >}}
100
107
101
108
```bash
102
-
operate-schema get -s mysql-replica-01 task_single -d db_single -t t1
109
+
binlog-schema list -s mysql-replica-01 task_single db_single t1
--flush flush the table info and checkpoint immediately (default true)
145
+
--from-source use the schema from upstream database as the schema of the specified tables
146
+
--from-target use the schema from downstream database as the schema of the specified tables
147
+
-h, --help help for update
148
+
--sync sync the table info to master to resolve shard ddl lock, only for optimistic mode now (default true)
149
+
150
+
Global Flags:
151
+
-s, --source strings MySQL Source ID.
152
+
```
121
153
122
154
If you want to set the table schema of the ``` `db_single`.`t1` ``` table corresponding to the `mysql-replica-01` MySQL source in the `db_single` task as follows:
0 commit comments