Google Cloud

Database Migration Service (DMS) Complete Guide: Oracle/MySQL/PG → Cloud SQL/AlloyDB

2026-05-24
NicheeLab Editorial Team

Database Migration Service (DMS) is a GCP service that performs managed migrations of on-prem or other-cloud databases into Cloud SQL, AlloyDB, BigQuery, or Firestore. With CDC-based Continuous Migration it minimizes downtime and also supports heterogeneous conversion (e.g., Oracle → PostgreSQL).

Supported Migration Paths

SourceTargetType
MySQL 5.5+Cloud SQL for MySQLHomogeneous (free)
PostgreSQL 9.4+Cloud SQL for PostgreSQL / AlloyDBHomogeneous (free)
SQL ServerCloud SQL for SQL ServerHomogeneous
Oracle 11g R2+AlloyDB / Cloud SQL for PostgreSQLHeterogeneous ($0.10/GB)
MongoDBFirestoreHeterogeneous
Oracle / SQL ServerBigQuery (CDC)Datastream

Migration Modes

  • One-time Migration: one-shot migration (with downtime)
  • Continuous Migration: initial sync + ongoing CDC delta sync → cutover
  • Promote: run cutover to promote to production

Oracle → AlloyDB Migration Example

# 1. Database Migration Assessment
gcloud database-migration migration-jobs assessments create \
  --source-database-engine=ORACLE \
  --source-connection-profile=oracle-source \
  --location=asia-northeast1

# Assessment result: migration feasibility + PL/SQL → PL/pgSQL convertibility

# 2. Create connection profile (source)
gcloud database-migration connection-profiles create oracle oracle-source \
  --host=10.0.0.1 --port=1521 --username=migration_user \
  --password=... --location=asia-northeast1

# 3. Create connection profile (target AlloyDB)
gcloud database-migration connection-profiles create alloydb alloydb-target \
  --alloydb-cluster=projects/PROJECT/locations/asia-northeast1/clusters/my-cluster \
  --location=asia-northeast1

# 4. Create migration job (Continuous)
gcloud database-migration migration-jobs create my-job \
  --type=CONTINUOUS \
  --source=oracle-source --destination=alloydb-target \
  --location=asia-northeast1

# 5. Start (initial data transfer + CDC begins)
gcloud database-migration migration-jobs start my-job --location=asia-northeast1

# 6. Check progress
gcloud database-migration migration-jobs describe my-job --location=asia-northeast1

# 7. Cutover (after switching app connections)
gcloud database-migration migration-jobs promote my-job --location=asia-northeast1

Homogeneous (MySQL → Cloud SQL) Flow

  1. Source MySQL: enable binary logging and grant dump privileges
  2. Create a connection profile
  3. Create a migration job (Continuous)
  4. Initial dump → automatic transfer
  5. Continuous delta sync via CDC
  6. Switch the app's connection string to Cloud SQL
  7. Promote the migration job (production cutover)

Elements Converted in Heterogeneous (Oracle → PostgreSQL)

OraclePostgreSQL/AlloyDB
VARCHAR2(n)VARCHAR(n)
NUMBERNUMERIC
DATETIMESTAMP
CLOB / BLOBTEXT / BYTEA
SEQUENCESEQUENCE (syntax differences)
PL/SQL Stored ProcedurePL/pgSQL (auto-converted by Assessment; review required)
TriggerTrigger (syntax differences)
View / IndexMigrated as-is

Datastream (Real-time CDC)

  • Streams Oracle / MySQL / SQL Server changes into BigQuery / GCS / Spanner
  • Near real-time (seconds to minutes)
  • Use cases: real-time analytics, always-on data-lake updates, replica creation
  • Can be combined with DMS to continue with CDC after migration

Pricing Examples

ItemPrice
MySQL → Cloud SQLFree (only Cloud SQL charges apply)
PostgreSQL → AlloyDBFree
Oracle → AlloyDB$0.10/GB processed data
Datastream$0.30/GB ingested

Best Practices

  • Confirm compatibility up front with Migration Assessment
  • Validate Continuous Migration in a test environment
  • Cutover plan + rollback plan
  • Update the app's connection string to go through Cloud SQL Auth Proxy
  • Schedule the cutover during the lowest-impact business window
  • Keep the source DB for 1-2 weeks after cutover as an emergency fallback
  • Optimize post-migration with AlloyDB AI / Index Advisor

What is Database Migration Service (DMS)?

A managed service that migrates on-prem or other-cloud databases to Cloud SQL, AlloyDB, or BigQuery. Minimal downtime plus continuous CDC sync keeps production impact low.

Which migration paths are supported?

MySQL → Cloud SQL / AlloyDB, PostgreSQL → Cloud SQL / AlloyDB, Oracle → AlloyDB / PostgreSQL (Heterogeneous), SQL Server → Cloud SQL for SQL Server, MongoDB → Firestore.

How is it priced?

Homogeneous migrations (e.g., MySQL → MySQL) are free. Heterogeneous (Oracle → PostgreSQL) is $0.10/GB of processed data. Cloud SQL / AlloyDB charges apply separately.

How short can the downtime be?

With Continuous Migration, production keeps running while deltas sync. Only the cutover takes a few to several dozen minutes. A read-replica pattern is also possible.

What gets converted in an Oracle migration?

PL/SQL is auto-converted to PL/pgSQL (via Database Migration Assessment), along with data-type mappings, sequences, triggers, and views. Not 100% automatic, but dramatically less manual work.

How does it relate to Datastream?

Datastream streams CDC (Change Data Capture) into BigQuery / GCS / Spanner. DMS handles full migration. Use Datastream for real-time analytics and DMS for migrations.

How does it compare with AWS DMS?

Both are managed DB migration services. GCP DMS supports AlloyDB and has strong PostgreSQL compatibility; AWS DMS covers more source databases. In multi-cloud setups, you may use both.

How does rollback work on failure?

During Continuous Migration the source DB is still live, so rollback is simply 'cancel the cutover.' Rolling back after cutover requires preserving the source DB state.

Related articles: Migration / DB

GCP Professional Cloud Database Engineer (PCDBE) 完全ガイド|Spanner・AlloyDB・Cloud SQL

Google Cloud Professional Cloud Database Engineer の試験範囲、Spanner / AlloyDB / Cloud SQL / Bigtable / Firestore、AWS DBS・Azure DP-300 比較を詳解。

Cloud SQL vs AlloyDB 徹底比較|PostgreSQL マネージド DB 選び方 (GCP)

Google Cloud Cloud SQL と AlloyDB for PostgreSQL の徹底比較。料金、性能、HA、HTAP、Vector 検索 (pgvector / AlloyDB AI)、Aurora 代替評価、Database Migration Service を解説。

GCP vs AWS ストレージ・DB 徹底比較|GCS/S3・BigQuery/Redshift・Spanner/DynamoDB (2026)

GCP と AWS のストレージ・データベースを徹底比較。Cloud Storage vs S3、BigQuery vs Redshift、Spanner vs DynamoDB / Aurora DSQL、Cloud SQL vs RDS、AlloyDB vs Aurora、Firestore vs DynamoDB、Bigtable vs DynamoDB を 2026 年最新版で網羅。

Sensitive Data Protection (旧 Cloud DLP) 完全ガイド|PII 検知・マスキング (GCP)

Google Cloud Sensitive Data Protection (旧 Cloud DLP) の全機能解説。200+ infoType、Discovery (BQ/SQL/GCS 自動探索)、De-identification (Masking / Tokenization / FPE)、料金、AWS Macie / Azure Purview 比較を 2026 年最新版で網羅。

Google Cloud is a trademark of Google LLC. For the latest details, see the official DMS documentation.

Check what you learned with practice questions

Practice with certification-focused question sets

Visit the GCP exam prep page
Author

NicheeLab Editorial Team

NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.


Related articles
Google Cloud

Google Cloud Certification Roadmap (2026)

Choose your GCP certification path — Foundational, Associate...

Google Cloud

CDL Cloud Digital Leader: Complete Exam Guide (2026)

Pass the Cloud Digital Leader exam — cloud business value, G...

Google Cloud

GAIL Generative AI Leader: Complete Exam Guide (2026)

Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...

Google Cloud

Vertex AI Fundamentals for GCP Certs (2026)

Vertex AI basics every cert candidate needs — Workbench, Pip...

Google Cloud

Associate Cloud Engineer (ACE): Complete Guide (2026)

Pass the Associate Cloud Engineer exam — Console, gcloud, pr...

Browse all Google Cloud articles (103)
© 2026 NicheeLab All rights reserved.