Skip to content

Commit 6c02b9b

Browse files
committed
enhance flags and user permissions
1 parent c363464 commit 6c02b9b

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

src/current/_includes/molt/replicator-flags-usage.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The following [MOLT Replicator]({% link molt/molt-replicator.md %}) flags are **
77
| `--slotName` | **Required.** PostgreSQL replication slot name. Must match the slot name specified with `--pglogical-replication-slot-name` in the [MOLT Fetch command](#start-fetch). |
88
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
99
| `--stagingSchema` | **Required.** Staging schema name for replication metadata and checkpoints. |
10-
| `--stagingCreateSchema` | Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
10+
| `--stagingCreateSchema` | **Required.** Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
1111
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
1212
</section>
1313

@@ -17,27 +17,27 @@ The following [MOLT Replicator]({% link molt/molt-replicator.md %}) flags are **
1717
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
1818
| `--defaultGTIDSet` | **Required.** Default GTID set for changefeed. |
1919
| `--stagingSchema` | **Required.** Staging schema name for replication metadata and checkpoints. |
20-
| `--stagingCreateSchema` | Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
20+
| `--stagingCreateSchema` | **Required.** Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
2121
| `--fetchMetadata` | Explicitly fetch column metadata for MySQL versions that do not support `binlog_row_metadata`. Requires `SELECT` permissions on the source database or `PROCESS` privileges. |
2222
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
2323
| `--userscript` | Path to a userscript that enables table filtering from MySQL sources. Refer to [Table filter userscript](#table-filter-userscript). |
2424

25-
Replication from MySQL requires `--defaultGTIDSet`, which sets the starting GTID for replication. You can find this value in the `cdc_cursor` field of the `fetch complete` message after the [initial data load](#start-fetch) completes.
25+
You can find the starting GTID in the `cdc_cursor` field of the `fetch complete` message after the [initial data load](#start-fetch) completes.
2626
</section>
2727

2828
<section class="filter-content" markdown="1" data-scope="oracle">
29-
| Flag | Description |
30-
|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
31-
| `--sourceSchema` | **Required.** Source schema name on Oracle where tables will be replicated from. |
32-
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
33-
| `--scn` | **Required.** Snapshot System Change Number (SCN) for the initial changefeed starting point. |
34-
| `--backfillFromSCN` | **Required.** SCN of the earliest active transaction at the time of the snapshot. Ensures no transactions are skipped. |
35-
| `--stagingSchema` | **Required.** Staging schema name for replication metadata and checkpoints. |
36-
| `--stagingCreateSchema` | Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
37-
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
38-
| `--userscript` | Path to a userscript that enables table filtering from Oracle sources. Refer to [Table filter userscript](#table-filter-userscript). |
29+
| Flag | Description |
30+
|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
31+
| `--sourceSchema` | **Required.** Source schema name on Oracle where tables will be replicated from. |
32+
| `--targetSchema` | **Required.** Target schema name on CockroachDB where tables will be replicated. |
33+
| `--scn` | **Required.** Snapshot System Change Number (SCN) for the initial changefeed starting point. |
34+
| `--backfillFromSCN` | **Required.** SCN of the earliest active transaction at the time of the snapshot. Ensures no transactions are skipped. |
35+
| `--stagingSchema` | **Required.** Staging schema name for replication metadata and checkpoints. |
36+
| `--stagingCreateSchema` | **Required.** Automatically create the staging schema if it does not exist. Include this flag when starting replication for the first time. |
37+
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
38+
| `--userscript` | Path to a userscript that enables table filtering from Oracle sources. Refer to [Table filter userscript](#table-filter-userscript). |
3939

40-
Replication from Oracle requires `--sourceSchema`, `--scn`, and `--backfillFromSCN`. The `--sourceSchema` specifies the Oracle schema to replicate from, while `--scn` and `--backfillFromSCN` specify the snapshot SCN and the earliest active transaction SCN, respectively. You can find the SCN values in the message `replication-only mode should include the following replicator flags` after the [initial data load](#start-fetch) completes.
40+
You can find the SCN values in the message `replication-only mode should include the following replicator flags` after the [initial data load](#start-fetch) completes.
4141
</section>
4242

4343
{% elsif page.name == "migrate-resume-replication.md" %}
@@ -46,7 +46,7 @@ Replication from Oracle requires `--sourceSchema`, `--scn`, and `--backfillFromS
4646
| `--stagingSchema` | **Required.** Staging schema name for the changefeed checkpoint table. |
4747
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
4848

49-
Resuming replication requires `--stagingSchema`, which specifies the staging schema name used as a checkpoint. The staging schema was created during [initial replication setup]({% link molt/migrate-load-replicate.md %}#start-replicator) with `--stagingCreateSchema`.
49+
The staging schema was created during [initial replication setup]({% link molt/migrate-load-replicate.md %}#start-replicator) with `--stagingCreateSchema`.
5050

5151
<section class="filter-content" markdown="1" data-scope="mysql oracle">
5252
{{site.data.alerts.callout_info}}
@@ -63,7 +63,7 @@ When using `--table-filter`, you must also include `--userscript`. Refer to [Tab
6363
| `--tlsPrivateKey` | Path to the server TLS private key for the webhook sink. Refer to [TLS certificate and key](#tls-certificate-and-key). |
6464
| `--metricsAddr` | Enable Prometheus metrics at a specified `{host}:{port}`. Metrics are served at `http://{host}:{port}/_/varz`. |
6565

66-
- Failback requires `--stagingSchema`, which specifies the staging database name used for replication checkpoints and metadata. The staging schema is first created with [`--stagingCreateSchema`]({% link molt/migrate-load-replicate.md %}). For details on the staging schema, refer to [Staging database]({% link molt/molt-replicator.md %}#staging-database).
66+
- The staging schema is first created during [initial replication setup]({% link molt/migrate-load-replicate.md %}#start-replicator) with `--stagingCreateSchema`.
6767

6868
- When configuring a [secure changefeed](#tls-certificate-and-key) for failback, you **must** include `--tlsCertificate` and `--tlsPrivateKey`, which specify the paths to the server certificate and private key for the webhook sink connection.
6969

src/current/molt/molt-fetch.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ The following source databases are supported:
3535

3636
Ensure that the source and target schemas are identical, unless you enable automatic schema creation with the [`drop-on-target-and-recreate`](#target-table-handling) option. If you are creating the target schema manually, review the behaviors in [Mismatch handling](#mismatch-handling).
3737

38+
{{site.data.alerts.callout_info}}
39+
MOLT Fetch does not support migrating sequences. If your source database contains sequences, refer to the [guidance on indexing with sequential keys]({% link {{site.current_cloud_version}}/sql-faqs.md %}#how-do-i-generate-unique-slowly-increasing-sequential-numbers-in-cockroachdb). If a sequential key is necessary in your CockroachDB table, you must create it manually. After using MOLT Fetch to load the data onto the target, but before cutover, make sure to update each sequence's current value using [`setval()`]({% link {{site.current_cloud_version}}/functions-and-operators.md %}#sequence-functions) so that new inserts continue from the correct point.
40+
{{site.data.alerts.end}}
41+
3842
If you plan to use cloud storage for the data migration, follow the steps in [Cloud storage security](#cloud-storage-security).
3943

4044
### User permissions
@@ -46,7 +50,7 @@ The SQL user running MOLT Fetch requires specific privileges on both the source
4650
| PostgreSQL source | <ul><li>`CONNECT` on database.</li><li>`USAGE` on schema.</li><li>`SELECT` on tables to migrate.</li></ul> | [Create PostgreSQL migration user]({% link molt/migrate-bulk-load.md %}#create-migration-user-on-source-database) |
4751
| MySQL source | <ul><li>`SELECT` on tables to migrate.</li></ul> | [Create MySQL migration user]({% link molt/migrate-bulk-load.md %}?filters=mysql#create-migration-user-on-source-database) |
4852
| Oracle source | <ul><li>`CONNECT` and `CREATE SESSION`.</li><li>`SELECT` and `FLASHBACK` on tables to migrate.</li><li>`SELECT` on metadata views (`ALL_USERS`, `DBA_USERS`, `DBA_OBJECTS`, `DBA_SYNONYMS`, `DBA_TABLES`).</li></ul> | [Create Oracle migration user]({% link molt/migrate-bulk-load.md %}?filters=oracle#create-migration-user-on-source-database) |
49-
| CockroachDB target | <ul><li>`SELECT` on target tables.</li><li>Privileges to run [`IMPORT INTO`]({% link {{site.current_cloud_version}}/import-into.md %}#required-privileges) or [`COPY FROM`]({% link {{site.current_cloud_version}}/copy.md %}#required-privileges).</li></ul> | [Create CockroachDB user]({% link molt/migrate-bulk-load.md %}#create-the-sql-user) |
53+
| CockroachDB target | <ul><li>`ALL` on target database.</li><li>`CREATE` on schema.</li><li>`SELECT`, `INSERT`, `UPDATE`, `DELETE` on target tables.</li><li>For `IMPORT INTO`: `SELECT`, `INSERT`, `DROP` on target tables. Optionally `EXTERNALIOIMPLICITACCESS` for implicit cloud storage authentication.</li><li>For `COPY FROM`: `admin` role.</li></ul> | [Create CockroachDB user]({% link molt/migrate-bulk-load.md %}#create-the-sql-user) |
5054

5155
## Installation
5256

0 commit comments

Comments
 (0)