Introduction

If you are running an Oracle Autonomous AI Database on the legacy OCPU billing model, updating to ECPU is a straightforward way to unlock features that are only available on ECPU. ECPU is the long-term foundation for Autonomous AI Database compute, and new databases can only be provisioned on it. Existing OCPU databases continue to work, but they are not eligible for ECPU exclusive features.

If you want to know more about ECPU’s and the differences between OCPU and ECPU you can refer to this ECPU FAQ.

This blog walks you through how to migrate your Autonomous AI Database from the legacy OCPU billing model to ECPU.

How to Update: Three Ways to Make the Switch

Here, we present three options to update your Autonomous AI Database…

Option 1 — OCI Console

The first one is through the OCI Console. The database remains fully accessible throughout the entire process, there is no downtime.

  1. Log into the OCI Console and navigate to Oracle AI Database > Autonomous AI Database. Select the database you want to update.
  2. On the database detail page, locate the Resource allocation section and click Update to ECPU model next to the OCPU count field.
  3. Review the pre-populated ECPU count and Compute auto scaling values. These fields are read-only during this step, you can adjust them after the update completes.
  4. Click Save. The lifecycle state will change to Updating, then return to Available once the update is complete.

Option 2 — Terraform

If your infrastructure is managed with Terraform, you can update using the OCI Terraform provider. Because the database already exists outside of Terraform’s state, there is one extra step: you must import it before applying changes.

Oracle’s sample Terraform project

Oracle provides a ready-to-use Terraform example specifically for this update. You can find it in the Oracle Developer GitHub repository. It includes all the files you need. Clone it and adapt it to your environment, or use it as a reference alongside your existing Terraform project.

The key configuration changes are highlighted in the steps below.

Step 1 — Update main.tf

Replace cpu_core_count with compute_count and set compute_model = “ECPU”. These two parameters must not be used together or the API will return a 400 error if both are present.

resource "oci_database_autonomous_database" "adb" {
  compartment_id           = var.compartment_ocid
  display_name             = var.adb_display_name
  db_name                  = var.adb_db_name
  admin_password           = var.adb_admin_password
  db_workload              = var.adb_workload_type
  data_storage_size_in_tbs = var.adb_storage_tbs
  is_auto_scaling_enabled  = var.adb_auto_scaling
  # Changed from OCPU to ECPU
  # Use compute_model + compute_count — never use cpu_core_count
  compute_model = "ECPU"
  compute_count = var.adb_cpu_core_count
  lifecycle {
    ignore_changes = [admin_password]
  }
}

Step 2 — Update variables.tf

Add or update the variable for CPU count. The validation block below enforces ECPU sizing rules at plan time, preventing invalid configurations from being applied.

variable "adb_cpu_core_count" {
  description = "ECPUs (min 2, multiples of 2)"
  type        = number
  default     = 2
  validation {
    condition     = var.adb_cpu_core_count >= 2 &&
                    var.adb_cpu_core_count % 2 == 0
    error_message = "Must be >= 2 and a multiple of 2."
  }
}

Step 3 — Import and apply

Terraform can only manage resources it created. Since this database was provisioned outside of Terraform (or in a previous state file), you need to import it first. The import command reads the current state of the database from OCI and registers it in your local terraform.tfstate file, without this step, Terraform would attempt to create a new database instead of updating the existing one.

The import does not modify the database itself. It only updates your local state file.

Run the following commands in order from your Terraform project directory:

# 1. Initialize the Terraform working directory
terraform init

# 2. Import the existing database into Terraform state
# Replace <ADB_OCID> with your actual Autonomous AI Database OCID
terraform import oci_database_autonomous_database.adb <ADB_OCID>

# 3. Preview the changes — verify only compute_model and compute_count are changing
terraform plan

# 4. Apply
terraform apply

Option 3 — OCI CLI

If you prefer working from the command line, you can perform the update with a single OCI CLI command. Like the other options, this is a zero-downtime operation.

Execute:

oci db autonomous-database update \
--autonomous-database-id <ADB_OCID> \
--compute-model ECPU \
--compute-count <number_of_ecpus> \
--wait-for-state AVAILABLE

Replace <ADB_OCID> with your Autonomous AI Database OCID and <number_of_ecpus> with your target ECPU count. The –wait-for-state AVAILABLE flag holds the command until the update completes and the database is back online.

Conclusion

Updating to ECPU is a straightforward process that moves your Autonomous AI Database to Oracle’s current compute standard. Whether you use the Console, Terraform, or the OCI CLI, the update is zero-downtime and keeps your data intact.