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
STOPPEDstate.
- The database system's lifecycle state transitions to
- 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
ACTIVEstate.
Because the FQDN and private IP addresses remain the same, client applications reconnect seamlessly.
- The lifecycle state transitions to
Database System Behavior in STOPPED State
- Start database system (
RestartDbInstanceInDbSystem): The primary action to bring the system back to anACTIVEstate. - Delete database system (
DeleteDbSystem): The system and its associated storage can be permanently deleted. - Get or list operations: Read-only operations such as
GetDbSystem,ListDbSystems, andGetPrimaryDbInstancefunctions correctly.
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
STOPPEDstate, 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.
Use the
oci psql db-system stopcommand 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 startcommand 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
dbSystemIdattribute to stop a database system.Run the StartDbSystem operation with the
dbSystemIdattribute 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
- 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, andshapevalues in the start operation.