Question 458 of 503
Plan and manage database infrastructuremediumMultiple ChoiceObjective-mapped

Quick Answer

The best approach is to rewrite the stored procedures and triggers to Spanner-compatible SQL and use a heterogeneous migration tool. This is correct because Oracle’s PL/SQL is a procedural language with features like cursors, exception handling, and package variables that have no direct equivalent in Cloud Spanner’s GoogleSQL dialect, which relies on standard SQL with limited procedural constructs. A heterogeneous migration tool such as Striim or Datastream can handle schema and data conversion, but it cannot translate application logic—so the stored procedures must be manually rewritten to use Spanner’s supported DML and, where possible, its native stored procedures. On the Google Professional Cloud Database Engineer exam, this scenario tests your understanding that migrating from Oracle to Spanner is not a lift-and-shift; a common trap is assuming a homogeneous tool like Database Migration Service can handle PL/SQL, when in fact it cannot. Remember the memory tip: “PL/SQL must fall—rewrite for Spanner’s call.”

PCDE Plan and manage database infrastructure Practice Question

This PCDE practice question tests your understanding of plan and manage database infrastructure. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company is migrating an Oracle database to Cloud Spanner. The Oracle database has complex stored procedures and triggers. What is the best approach?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "best"

    Why it matters: Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.

Question 1mediummultiple choice
Full question →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Rewrite the stored procedures and triggers to Spanner-compatible SQL and use a heterogeneous migration tool.

Option C is correct because Oracle stored procedures and triggers are written in PL/SQL, which is not compatible with Cloud Spanner's SQL dialect. A heterogeneous migration tool (e.g., Striim or Datastream with custom transforms) can handle schema and data conversion, but the application logic must be rewritten to Spanner-compatible SQL (e.g., using Cloud Spanner's stored procedures in GoogleSQL). This ensures the business logic is preserved and optimized for Spanner's distributed architecture.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use Dataflow to stream data from Oracle to Spanner.

    Why it's wrong here

    Dataflow can handle data streaming but does not migrate stored procedures/triggers; rewriting is still required.

  • Use BigQuery to load data then export to Spanner.

    Why it's wrong here

    This approach adds unnecessary complexity and does not address procedural code conversion.

  • Rewrite the stored procedures and triggers to Spanner-compatible SQL and use a heterogeneous migration tool.

    Why this is correct

    Spanner uses standard SQL with limited procedural support; rewriting is necessary, and a tool like Dataflow can migrate data.

    Clue confirmation

    The clue word "best" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Use Database Migration Service for homogenous migration.

    Why it's wrong here

    Database Migration Service supports homogeneous migrations (MySQL, PostgreSQL), not Oracle to Spanner.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates assume Database Migration Service (DMS) can handle any migration, but DMS only supports homogeneous migrations (same database engine), and Oracle to Spanner is heterogeneous, requiring a rewrite of stored procedures and triggers.

Detailed technical explanation

How to think about this question

Under the hood, Cloud Spanner uses GoogleSQL or PostgreSQL-dialect, neither of which support Oracle's PL/SQL procedural extensions like cursors, packages, or autonomous transactions. A heterogeneous migration tool like Striim or Datastream can handle schema mapping and data transfer, but stored procedures must be manually rewritten into Spanner's supported constructs (e.g., using Cloud Spanner's read-write transactions and client libraries). In real-world scenarios, organizations often use a combination of tools: a migration service for data, and a code conversion tool (e.g., AWS DMS with custom scripts) for logic, but the key is that the application layer must be refactored to avoid reliance on database-specific features.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A startup's cloud architect reviews their monthly bill and notices costs are higher than expected for a long-running batch job. Switching from on-demand instances to Reserved Instances — or using Spot/Preemptible VMs — can reduce compute costs by up to 72 %. Questions like this test whether you understand the tradeoffs between commitment, flexibility, and cost across cloud pricing models.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PCDE practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free PCDE practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PCDE question test?

Plan and manage database infrastructure — This question tests Plan and manage database infrastructure — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Rewrite the stored procedures and triggers to Spanner-compatible SQL and use a heterogeneous migration tool. — Option C is correct because Oracle stored procedures and triggers are written in PL/SQL, which is not compatible with Cloud Spanner's SQL dialect. A heterogeneous migration tool (e.g., Striim or Datastream with custom transforms) can handle schema and data conversion, but the application logic must be rewritten to Spanner-compatible SQL (e.g., using Cloud Spanner's stored procedures in GoogleSQL). This ensures the business logic is preserved and optimized for Spanner's distributed architecture.

What should I do if I get this PCDE question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "best". Signals that multiple options may be partially correct. Choose the option that most directly solves the exact problem described, not the one that sounds most complete.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More PCDE practice questions

Last reviewed: Jun 25, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCDE exam.