Create an Oracle Database (DB System) on Oracle OCI Cloud

Fathi Riadh
8 min readOct 12, 2018

--

Not many know the way to create an Oracle Database in Oracle Cloud Infrastructure (OCI). I will only focus on how to create a DB System as a Virtual Machine as that is the best option to try during the FREE 30 Day Trial. On a paid account you can also spin up databases that are running on Bare Metal Server meaning you get full exclusive access to an entire server.

Most of the information found here is taken from the official docs and I just updated it and made it more concise for an easier deployment.

The steps needed to create an Oracle database in OCI are:

  1. Create a network
  2. Create the database

So let’s take it one step at a time, it should take you around 10 minutes to complete all the steps the first time you do this.

  1. Create a network- VCN

Open the new OCI navigation menu. Under Networking, click Virtual Cloud Networks

Click on Create Virtual Cloud Network

Now we need to select the compartment where this network will be available. For my case I’ll use the default root compartment.

Then you need to give this network a name, like DB System Network for example.

And the last and most important part is to select what type of network we want. For CREATE VIRTUAL CLOUD NETWORK ONLY we will have a private network that is NOT accessible from the internet. For CREATE VIRTUAL CLOUD NETWORK PLUS RELATED RESOURCES we will have public facing network that is accessible from the Internet but with almost all ports closed and protected by the Oracle Cloud perimeter firewall.

Almost always for trying out the Oracle Cloud you would go with the second option and have a public facing network.This network will be created automatically with an Internet Gateway, Subnets, DHCP and Security Lists.

Now you can click on Create Virtual Network and you will be ready to use it in a few seconds:

2. Create the database:

Open the navigation menu. Under Database, click Bare Metal, VM, and Exadata

For your Compartment, leave it as the default root for now, you can create multiple compartments in case you have many databases and want to organize them.

Click Create DB System.

In the Launch DB System dialog, enter the following:

  • Select a compartment : As before, select the same compartment as the VCN is using (root in my case) .
  • Name your DB System : Give a friendly, display name for the DB system.
  • Availability Domain: The availability domain (data center) in which the DB system will run. Select any of the three available.
  • Shape Type: The shape determines the type of DB system and the resources allocated to the system. For a TRIAL the only available shape type is Virtual Machine. For this example I will use VM.Standard2.1 that is a 1 OCPU and 15GB memory instance that is suitable for most test cases. In the trial the only other available shape would be VM.Standard2.2
  • Total Node Count: The number of nodes in the DB system — the number of different virtual machines that run your database. This option depends on the shape you select.For VM.Standard2.1 the option is grayed out as you need bigger shapes (2.2 on wards) to use this.If you wish to use RAC (Real Application Clusters) for high availability you need to change the shape to 2.2.
  • Oracle Database Software Edition: The database edition supported by the DB system. You have the option to go with Standard Edition database for smaller DB needs (that have no options available, only encryption ) or with Enterprise Edition ones for more advanced needs and also added options like Masking, Tuning, Multitenant, Data Guard etc.
  • Oracle Storage Management Software : By default you are provided an ASM file system to store the database files using Oracle Grid Infrastructure. If you use RAC you also will need to use this option. Select Logical Volume Manager if you want to have the database deployed quickly (~15 minutes).
  • Available Storage : The amount of storage the DB System will have available. You can increase this size after creating the instance if needed.
  • SSH Public Key: The public key portion of the key pair you want to use for SSH access to the DB system. You can use PuttyGen on a Windows machine to create a key pair.

PuttyGen can be downloaded from: https://the.earth.li/~sgtatham/putty/latest/w32/puttygen.exe

Open the application after you download it and it would look like below. Click on Generate and start moving your mouse cursor randomly inside the PuttyGen window for the key to be created.

Copy and save the contents of the public key in a Notepad.

Then click on Save private key :

Now that we have a public and private key, we can use the Public Key in the database instance creation. Copy the contents of the Public key and paste it as below.

  • License Type: The type of license you want to use for the DB system. Your choice affects metering for billing, if you do not have an Oracle license, use the first option — License included

License included means the cost of the cloud service includes a license for the Database service.Bring Your Own License (BYOL) means you are an Oracle Database customer with licenses and an active Oracle Support contract and you have 1 free license that you are not currently using and want to use it in the Oracle Cloud.

Network Information

  • Virtual Cloud Network: The VCN in which to launch the DB system. Select the one we created earlier.
  • Client Subnet: The subnet to which the DB system should attach. You only have one option so select the default one.
  • Hostname Prefix: Give a host name prefix for the Linux DB system. The host name must begin with an alphabetic character, and can contain only alphanumeric characters and hyphens (-).

Database Information

  • Database Name: The name for the database. I’ll give ORCL name. It must begin with an alphabetic character and no special characters.
  • Database Version: The version of the database created on the DB system when it is launched. I’ll go with 12.2.0.1 for now.
  • PDB Name: Not applicable to version 11.2.0.4. The name of the pluggable database. Alphanumeric characters permitted, so I’ll use PDB01.
  • Database Admin Password: A strong password for SYS, SYSTEM, TDE wallet, and PDB Admin. Don’t use oracle in the password as it will not work.
  • Select workload type: you have two options: OLTP for most transaction processing use cases — this for the generic database with many Inserts and Updates to the data, and I’ll select this one, and DSS for data warehouse systems for lot’s of scanning of data.
  • Automatic Backup: Check the check box to enable automatic incremental backups for this database. You can change the retention period of the backups and the time of day they are taken.
  • Character Set: Inside the Advanced Options link you can change the character set for the database. The default is AL32UTF8. National Character Set: The national character set for the database. The default is AL16UTF16.

Finish the instance creation by clicking on Create DB System.

The DB system appears in the list with a status of Provisioning. The DB system’s icon changes from yellow to green (or red to indicate errors).

Wait for the DB system’s icon to turn green, with a status of Available, details about the DB system shape and OCPUs are displayed.

Where is the IP address ??

Good question, unfortunately the Public IP of the DB System is not show on the main page, you need to find it elsewhere. You need to click on the DB System name you just created and then on the left hand side you need to click on Nodes:

In here we will find the Public IP of our database so we can connect to it:

Also in here we have the button to STOP/START/REBOOT the database virtual machine:

That’s it!

For more information and a complete guide on how to manage DB Systems please visit the docs HERE.

If you want to connect SQL Developer to the cloud database you can follow this other post I made : https://medium.com/@fathi.ria/sql-developer-connection-to-oracle-cloud-d6bb58507eae

And to connect your applications to the cloud database you will have to open ports on the cloud firewall like in this guide : https://medium.com/@fathi.ria/oracle-database-cloud-open-ports-on-oci-1af24f4eb9f2

Best of luck!

Riadh

--

--