Stopping and Starting a Database System in OCI Database with PostgreSQL

Start and stop database systems in OCI Database with PostgreSQL to optimize resource usage and reduce costs.

This functionality is useful for workloads with periodic or seasonal demand and for training environments where database systems are not always required.

When you stop a database system, the database and Compute resources are temporarily shut down. You can later start the system to restore full functionality without configuration changes.

Functionality

  • Stopping a database system: When you initiate a stop operation from the OCI Console, CLI, or API, the following actions occur:
    • The database system's lifecycle state transitions to Stopping.
    • The underlying Compute instances (VMs) are stopped and released.
    • The associated block volumes with all user data, including Write-Ahead Log (WAL) volumes are detached but preserved.
    • Network resources, such as the VCN, FQDN, and private endpoints, are preserved.
    • Billing for Compute resources is halted. In the stopped state, the service fee is reduced to 25%.
    • After completion, the database system, database system management, and database instances enter the STOPPED state.
  • Starting a database system: When you start a stopped system:
    • The lifecycle state transitions to STARTING.
    • A new Compute instance of the same shape is provisioned and attached to the preserved block volume and network resources.
    • Billing for Compute resources resumes.
    • The original network resources (VCN, FQDN, private endpoints) are wired to the new instance.
    • After completion, the database system, database system management, and database instances return to the ACTIVE state.

    Because the FQDN and private IP addresses remain the same, client applications reconnect seamlessly.

Database System Behavior in STOPPED State

When a database system is stopped, only specific actions are allowed. The allowed operations during a stopped state are:

When you start the database system, it checks if patching or certificate rotation is needed and applies them if required. If the security certificate is set to expire within 20 days of the start command, the database system automatically rotates the certificate and applies any necessary patches before becoming ACTIVE.

Database System Behavior in STARTING State

  • Proactive certificate rotation: If the database system's identity certificate is set to expire within 20 days, the system forces a rotation to reduce the risk of service interruption after patching.
  • Offline rotation synchronization: If a certificate rotation occurs globally while the database system is in a STOPPED state, the system retains a legacy certificate. Start the patch process to synchronize the system with the current active certificate.
  • Image version alignment: If the database system is inactive during a release cycle, it might run an obsolete image ID. If the latest available image ID is newer than the provisioned image ID, the system is flagged for a mandatory image update during the patching window.
    1. On the Database systems list page, find the database system that you want to work with. If you need help finding the list page or the database system, see Listing OCI Database with PostgreSQL Database Systems.
      The database system's details page opens.
    2. Select one of the following:
      • From the Actions menu, select Stop to stop a system.
      • From the Actions menu, select Start to start a system.
        Note the following when you select the start or stop action:
        • The Stop button is available only when the database system is active, and the Start button only when the system is stopped.
        • Other actions, such as Restore, Patch are disabled when the system is stopped.
        • The Console shows the system status as Inactive when stopped.
        • A metric called DB system state is available (1 for ACTIVE, 0 for STOPPED).
  • Use the oci psql db-system stop command and required parameters to stop a database system:

    oci psql db-system stop --db-system-id <db-system_ocid> [OPTIONS]

    Use the oci psql db-system start command and required parameters to start the database system:

    oci psql db-system start --db-system-id <db-system_ocid> [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the StopDbSystem operation with the dbSystemId attribute to stop a database system.

    Run the StartDbSystem operation with the dbSystemId attribute to start the database system.

Troubleshooting

For issues related to the start stop workflow, check shape availability. If a start operation fails, confirm that the required Compute shape is available in the region.

Limitations

If a database system was created with a deprecated Compute shape, you can't restart it if that shape is no longer available in the region. To restart the database system, update the Compute shape and resource values using the available options:
  • OCI Console: The Console displays only the shapes that are valid in the region. Select an available shape to update the DB system.
  • SDK or Terraform: Pass the instanceOcpuCount, instanceMemorySizeInGBs, and shape values in the start operation.