Example workflow: Fix conversion issues in all code objects with Gemini assistance

This page describes a sample scenario where Gemini assistance expedites converting code objects in Database Migration Service conversion workspaces.

Costs

To use Gemini assistance in Database Migration Service conversion workspaces you need to enable Gemini API. Pricing for Gemini applies. For more information, see Gemini for Google Cloud pricing.

Before you begin

To use Gemini assistance in Database Migration Service conversion workspaces, you need to enable Gemini for Google Cloud in your project.

Enable the API

After you enable Gemini for Google Cloud in your project, Gemini features are enabled for all your conversion workspaces. You can later disable the suggestions in a specific workspace.

Example workflow

In this example scenario, you convert Oracle code and schema where multiple code objects use the same Oracle function that causes conversion issues. The rule-based conversion engine can't find a PostgreSQL equivalent for that function, so you need to fix the conversion issues yourself. To speed up the conversion process, you use Gemini conversion assistance to find out how to change the Oracle code.

Your SQL code and schema are stored in the region where you create the conversion workspace. If you use assisted code and schema conversion with Gemini models, your code and schemas might be processed in other regions.

Learn how and when Gemini for Google Cloud uses your data.

In your Gemini-powered workflow, you follow these steps:

  1. You open the details pane for one of the affected objects, and select Conversion assistant > Help me fix object conversion issues.
A screenshot that shows how to access Gemini prompts
      for code and schema conversion explainability.
Figure 1. Gemini conversion assistant prompts. (click to enlarge)
A screenshot that shows how to access Gemini prompts
      for code and schema conversion explainability.

The Gemini pane opens.

  1. In the Gemini pane, you click Insert suggestion and then save SQL changes.

  2. You repeat the steps for every faulty code object.

    As you apply the code proposals, Gemini models learn the pattern and offer to add the fix to all objects with the same issue. The Review suggestions from Gemini dialog appears.

    Gemini fix issues dialog.
    Figure 2. Gemini fix issues dialog. (click to enlarge)
    Gemini fix issues dialog.
  3. You click Review suggestions, and proceed to review suggested changes.

  4. For each object, you click Accept code and exit the Gemini suggestions view.

Now the conversion issue fix is applied to all faulty code objects in your workspace.