Friday, July 12, 2019

Oracle Cloud 2nd gen DBAAS Tutorial: Deploy a 2 Nodes RAC database service


Oracle Database Cloud Service (DBaaS) provides a platform to create full Oracle database instances in a virtual machine (VM). It's the same familiar Oracle Database, now in Oracle cloud.
Oracle made things even easier since you can now Sign Up for Free Oracle Cloud service and Get $300 of free credits good for up to 3500 hours of Oracle Cloud usage for 30 days. This could be a good oprtunity to have hands on experience in creating and managing Oracle Database Cloud Service .


This tutorial shows you how to create a RAC service instances in Oracle Database Cloud Service when creating a database deployment . I wanted to add the exhaustive list of steps including all the necessary information (Network,compute,RAC) so you could try it yourself using the free trial subscription.

Note : The components' names used in this example  (compartment 'ECorp',Internet Gateway,VCN,Subnet,DBname,PDB..etc) can be changed to the value of your liking.

• To create a Database Cloud Service database deployment that uses Oracle Real Application Clusters (Oracle RAC) , Follow the below steps and fill in the displayed information on each of the listed wizards.


A compartment is a logical container within your account used to store Oracle Cloud Infrastructure (OCI) Resources created within that compartment (such as compute, storage, and network) .

Go to – Identity section>compartments> Create compartment
                 > Name : ECorp 
> Description:
• Click create Compartment



  • Allowable VCN size range: /16 to /30. recommended (,172.16.0/12, and 192.168.0/16).
  • VCN reserves the first two IP addresses and the last one in each subnet's CIDR

1- Create the VCN

Go to Networking Section> Virtual Cloud Networks. 

> Create VCN only (VNC created without resources : add )
> Create in compartment : >Name : Ecorp
> VCN Name: Ecorpvcn
> CIDR block
> DNS resolution : use DNS hostname in this VNC
> DNS label:ecorpvcn >DnsDomain Name:    
> 'No Tags'

* [Skip if VCN only option was selected ]

   If you want to rather create a VCN with related resources : (option checked)

   The following resources will be added for you

- CIDR block range of 
- An internet gateway
- Default security list.
- A public subnet in each availability domain.
- Internet and VCN Resolver for DNS

2- Create the internet gateway

In this example the route table will direct traffic to an internet gateway.

Go to Networking and click Virtual Cloud Networks then Click Internet Gateways.

1. Click Create Internet gateway :> Create in Compartment :> name: ECorp
2. Create default route table RULE :
Target type : > InternetGuateway  :> Destination CIDR BLOCK :
> Compartment: ECorp
> Target Internet Gateway: Ecorp internet gateway

3- Create two Subnets (DATA & BACKUP)



  • A Subnet is a subdivision of your VCN that you define in a single availability domain. The subnet directs traffic
    according to a route table.

  • The Subnet also uses a security list to control traffic in and out of the instance. Each subnet exists in a single 
    availability domain.

  • A region contains several availability domains.

A- Create primary Subnet

Under VCN details page > click Create Subnet. 
> Name : Data                         #first subnet
> Availability Domain:  AD1
> CIDR block :
> Route Table: Default
> Public subnet
> DNS resolution: Use DNS hostname
> DNS label :data
> DNS Domain Name:
> DHCP : Default

B- Create backup Subnet

> Name : BAckup                         #second subnet
> Availability Domain: AD2
> CIDR block :
> Route Table: Default
> Public subnet
> DNS resolution: Use DNS hostname
> DNS label :backup
> DNS Domain Name:
> DHCP : default
Add ingress Rules (statefull rule) to the subnet Default Security list (all tcp allow all trafic for all ports)


Vm based Database System LAUNCH 

  • Two nodes RAC instance:  the main attributes here are The software edition, Database Type, and computer shape.

Go to Console >Click Create service page 
> Service Name : CloudRAC             #choose any name                       
> Description : > Service level : Oracle Database Cloud service
> Metering frequency : Hourly
> Software release : Oracle soft 12c R1
> Software Edition : EE Extreme performance
> Database Type: Db clustering with RAC 
> Client subnet:data
> Hostname: london                  #choose your hostname             
> DB Name SID: RACDB                #choose your DB instance name
> PDB Name: PDBRAC                  #choose your PDB name
> Admin Pass:New_Pass123#
> Usable storage : 25GB
> Compute Shape: VM.Standard1.2    #choose a shape with two or more OCPUs.
> SSH public key:   ....        #copy your own ssh key.
Follow this tutorial to create an ssh Public/Private Key Pair.
> Backup option :None
> Database Workload : OLTP
cluster name : london-cls   #choose your cluster name
Domain :
Service Name:    

The result

Here are the details of the created database system (see above step) .

DB System Version:
Oracle Database Software Edition: Enterprise Edition
Shape: VM.Standard1.2
Virtual Cloud Network: Ecorpvcn
Client Subnet: Data
Private IP:
Public IP:
Available Data Storage: 256 GB
Total Storage Size: 712 GB


TNS entries example
  Use the service name/public IPs generated after the DB system creation (available on the DB system details page)

(ADDRESS = (PROTOCOL = TCP)(HOST =publicIp1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =publicIp2)(PORT = 1521))

(ADDRESS = (PROTOCOL = TCP)(HOST =publicIp1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =publicIp2)(PORT = 1521))
Any Remark, comments ? Feel free to leave them below the article.