Tuesday, July 9, 2019

Changing OCI PaaS DB Shape

Currently the OCI PaaS DB doesn't have a way of changing its shape once created. For example if the DB is doing more load than initially anticipated and require more CPU power to be added then there's no simple way to increase the CPU count, which may be available on other cloud platforms. However, Oracle does provide the ability to change the shape of the host sever indirectly. This is done by creating a new DB using an existing backup.
The details of the existing DB is shown below. This post shows the steps for changing the DB host shape from VM2.1 to VM2.2.
It is possible to create a database using the backups created by the automatic backup service.
However, this would mean any new data written to the database since the backup was taken won't be included in the newly created database. To avoid that stop any write activity to the database (this would mean down time for the application) and create a manual backup. The process of creating a backup nor database from backup doesn't require the existing database to be shutdown. But to keep the data consistent between the two DB instances it would require a stop to all writes by the application. Once the user initiated backup completes, write click on the backup and select create database.
If there's an existing bare metal DB system then it could be used to create the new database (from backup). But if it is a virtual machine then only option is to create a new DB system.
Another thing to look out for is that, if the new DB system is created on the same subnet then it cannot have the same hostname as the original DB's hostname. This would mean either creating the new DB system on a different subnet or with a different hostname in the same subnet. For this post the later approach was chosen. It is also possible to create the database with same name or different name (in the post the new database has a different name). Depending on which option chosen may require some reconfiguration work on the application such as changing the DB connection string.



When the new DB system option is selected it allows to specify a new shape, which in this case was set as VM2.2, whereas the original DB was on a shape of VM2.1.
As mentioned earlier it also allows to create the new DB system on a different subnet and specify a new database name as well.
The final outcome is two database system with same data but different shapes.
If this was done as a scale up activity then once data consistency is verified the original database system could be terminated.

Related Posts
Duplicate Database Without Target Connection or Catalog Connection