Enabling or Disabling Automatic Storage Expansion

Enable automatic storage expansion on your DB system to avoid loss of service when the allocated storage space gets filled up.

Note

You cannot enable automatic storage expansion on an Always Free DB system.
You can use the following metrics to monitor the storage space of a DB system:
  • StorageAllocated: The maximum amount of space allocated to the DB system during the interval in GiB.
  • StorageUsed: The maximum amount of space used during the interval in GiB.
For more information about metrics, see Metrics.
If automatic storage expansion is enabled, it will expand the storage size of a DB system when
StorageUsed >= StorageAllocated - MIN(50, 8 + (StorageAllocated) ÷ 25)
It will expand the storage size by increasing the StorageAllocated:
StorageAllocated = StorageAllocated + MIN(50, 8 + (StorageAllocated) ÷ 25)
The expanded storage size will become the current storage size to compute the threshold for the next storage expansion when the free storage space becomes low again. After the storage size has reached the specified maximum storage size, it will not expand the storage size further.

Table 8-19 This table shows some examples of the computation of the StorageUsed that triggers the storage expansion.

StorageAllocated When StorageUsed hits StorageAllocated after expansion
50 50 - 10 = 40 50 + 10 = 60
100 100 - 12 = 88 100 + 12 = 112
200 200 - 16 = 184 200 + 16 = 216
500 500 - 28 = 472 500 + 28 = 528
800 800 - 40 = 760 800 + 40 = 840
1000 1000 - 48 = 952 1000 + 48 = 1048
1050 1050 - 50 = 1000 1050 + 50 = 1100
1100 1100 - 50 = 1050 1100 + 50 = 1150

You can build a chart to monitor the metrics over a period of time and identify whether the value has changed or when the value has changed. See Using Metrics to Create Queries. If needed, you can also create an alarm based on the metrics. See Using Metrics to Create Alarms.

Use one of the following method to enable or disable automatic storage expansion:

Using the Console

You can enable or disable automatic storage expansion using the Update storage size console action of the DB system.

Do the following to enable or disable automatic storage expansion of a DB system:

  1. On the DB systems list page, select the DB system that you want to work with. If you need help finding the list page or the DB system, see Listing DB Systems - Using the Console.

    The details page opens and displays information about the DB system.

  2. Select Details tab.
  3. Select Edit in the Automatic storage expansion field:
  4. In the Update storage size dialog box, select the Automatic storage expansion toggle switch to enable or disable automatic storage expansion.
    Note

    Enabling or disabling automatic storage expansion does not cause any downtime to the DB system.

  5. When automatic storage expansion is enabled, the Maximum data storage size field is shown. Enter the maximum storage size that you want to allow the storage size to expand to.
    Note

    You will be billed the new allocated storage size whenever the storage has been expanded.
  6. (Optional) You can also increase the current allocated storage size of the DB system. In the Update storage size dialog box, enter the new data storage size in GiB. You can only increase the storage size.
  7. Select Update.

Using the CLI

Use the command-line interface to enable or disable automatic storage expansion.

This task requires the following:
  • A DB system Oracle Cloud Identifier (OCID).
  • A properly configured CLI installation and the requisite SSH keys. See Command Line Interface.
  1. Open a command prompt and run the following command:
    oci mysql db-system update --db-system-id <DBSystemOCID> --is-auto-expand-storage-enabled <Boolean> --max-storage-size-in-gbs <SizeInGiB>
    • db-system-id: Specify the OCID of the DB system.
    • is-auto-expand-storage-enabled: Set to true to enable automatic storage expansion or false to disable it.
    • max-storage-size-in-gbs: Specify the maximum storage size, in GiB.
The command updates the DB system and returns the work request information.