Skip to content

MOLT Oracle documentation; refactor MOLT tutorials #19918

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

taroface
Copy link
Contributor

@taroface taroface commented Jul 11, 2025

DOC-14130
DOC-14259
DOC-13941

  • Document Oracle support for MOLT (in public preview)
  • Refactor MOLT tutorials to center on user journeys
    • Make guidance clearer and more explicit, including PKs requirement
  • Document Azure Blob Storage support

Please review:

Page preview Review link
Bulk Load https://github.com/cockroachdb/docs/pull/19918/files#diff-8b869a1172f94c4b14010f730ab39d51cdeee342497ee1aeb0ed8605c72e5e60
Load and Replicate https://github.com/cockroachdb/docs/pull/19918/files#diff-e33d9d713e7b66e47c4c9e6b1c4d696760ba4a6a56c91388371fcfb07d1b8702
Load and Replicate Separately https://github.com/cockroachdb/docs/pull/19918/files#diff-240a82fe78b31e2105a4a0882479b665d1c36a0553bbfea56dc7dba7cad1aba4
Resume Replication https://github.com/cockroachdb/docs/pull/19918/files#diff-7e788b5f71dd9e3d14bce14858a23ba0cf95efa88299496559d89ba54cab7dfb
Failback https://github.com/cockroachdb/docs/pull/19918/files#diff-15e68aea37ca1e37ede383feed074bf6973b939daadb0357f7997b97f919e9ac
MOLT Fetch https://github.com/cockroachdb/docs/pull/19918/files#diff-d33cc35311a672af48897ed330cc8692163816714829a86f5b667a7ebbda15f3
Migration Overview (new Migration Flows section) https://github.com/cockroachdb/docs/pull/19918/files#diff-39a1ebe415b90ca952a0d16cec1c23b6ec13ecce34d780cb27505e82c2a7e06b

The above pages use content from the _includes folder. Please review those documents as well.

Note that the PG and MySQL flows were updated as well. This is technically outside the scope of this PR, but I'd like to request a review of the SQL user creation steps for each dialect and for CRDB, as this hasn't previously been documented and I was making an educated guess in some places.

Copy link

netlify bot commented Jul 11, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 1621ce3
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/687573866742be0008fc39b7

Copy link

netlify bot commented Jul 11, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 1621ce3
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/68757386eec1970008910dd5

Copy link

github-actions bot commented Jul 11, 2025

Files changed:

Copy link

netlify bot commented Jul 11, 2025

Deploy Preview for cockroachdb-docs failed. Why did it fail? →

Name Link
🔨 Latest commit 21fb832
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/6870a0d7ada63e000859a849

Copy link

netlify bot commented Jul 11, 2025

Netlify Preview

Name Link
🔨 Latest commit 1621ce3
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/6875738619dc000008f37900
😎 Deploy Preview https://deploy-preview-19918--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Jeremyyang920
Copy link

image I saw this on the preview, but seems like a markdown reference isint resolved properly.

--target $TARGET \
--schema-filter 'migration_schema' \
--table-filter 'employees|payments|orders' \
--replicator-flags '--stagingSchema _replicator_1749699789613149000 --metricsAddr :30005 --userscript table_filter.ts' \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why the oracle example here is the only one with a userscript?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need userscript for table filtering on all source databases? I thought this was just oracle.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see. You would need this for MySQL as well.

Copy link

@ryanluu12345 ryanluu12345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work @taroface and @noelcrl . I can give this a more thorough look Monday, but left some high level comments for now


#### Table filter userscript

When migrating only a subset of tables using `--table-filter`, you **must** supply a userscript that filters change events to those tables. For example, save the following as `table_filter.ts`:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could benefit from a bit of clarity that --table-filter helps to filter out tables during initial data load and the userscript is for replication.

import * as api from "replicator@v1";

// List the source tables (matching case) to include in replication
const allowedTables = ["EMPLOYEES", "PAYMENTS", "ORDERS"];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be rewritten using a set or a dictionary so it's faster, but practically shouldn't make too much of a difference unless allowed tables is huge.

When migrating from Oracle Multitenant (PDB/CDB), this should be a [common user](https://docs.oracle.com/database/121/ADMQS/GUID-DA54EBE5-43EF-4B09-B8CC-FAABA335FBB8.htm). Prefix the username with `C##` (e.g., `C##MIGRATION_USER`).
{{site.data.alerts.end}}

Grant the migration user privileges to connect, read metadata, and `SELECT` and `FLASHBACK` the tables you plan to migrate. The tables should all reside in a single schema (e.g., `migration_schema`). For details, refer to [Schema and table filtering](#schema-and-table-filtering).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noelcrl is "schema" the precise name for this concept in Oracle? Would it also help here to link Oracle docs related to SELECT and FLASHBACK grants or show a sample GRANT query?

@@ -0,0 +1,22 @@
## Limitations

- Migrations must be performed from a single Oracle schema. You **must** include `--schema-filter` so that MOLT Fetch only loads data from the specified schema. Refer to [Schema and table filtering](#schema-and-table-filtering).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something for now, but we should also parse through https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.Oracle.html to understand what other limitations we would have too (since we both use LogMiner under the hood. FYI @taroface and @noelcrl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noelcrl In case this needs additional docs work, do you mind filing a new issue for me?

{% if page.name != "bulk-load.md" %}
- Replication will not work for tables or column names exceeding 30 characters. This is a [limitation of Oracle LogMiner](https://docs.oracle.com/en/database/oracle/oracle-database/21/sutil/oracle-logminer-utility.html#GUID-7594F0D7-0ACD-46E6-BD61-2751136ECDB4).

- Running DDL on the source or target while replication is in progress can cause replication failures.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make this a general warning for any dialect combinations. This is not Oracle specific.

- User-defined types (UDTs)
- Nested tables
- `VARRAY`
- `LONGBLOB`/`CLOB` columns (over 4000 characters)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it does support it but Replicator just doesn't right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@ryanluu12345 ryanluu12345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the rest just now. Looks good, just nits and clarifications. Agreed with Jeremy's comments. Can review after those are all addressed. I also want to ensure rest of the team can take a look here. @taroface it would be helpful if you could also link the exact docs preview section link so folks can see how it presents on the website

@taroface
Copy link
Contributor Author

Addressed all comments. PTAL!

The docs preview links are in the PR description.


## Migration failback
To minimize downtime during migration, MOLT Fetch supports replication streams that sync ongoing changes from the source database to CockroachDB. Instead of performing the entire data load during a planned downtime window, you can perform an initial load followed by continuous replication. Writes are only briefly paused to allow replication to drain before final cutover. The length of the pause depends on the volume of write traffic and the amount of replication lag between the source and CockroachDB.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nit, should we use "synchronize" instead of "sync" here?

Copy link

@ryanluu12345 ryanluu12345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes lgtm!

Copy link

@Jeremyyang920 Jeremyyang920 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Will let Noel sign off on the Oracle stuff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants