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

Intro

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 .

Purpose

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.

I. CREATE COMPARTMENT

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 

II. CREATE VCN & RELATED NETWORK RESOURCES

Specifications

  • Allowable VCN size range: /16 to /30. recommended (10.0.0.0/8,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 192.168.64.0/20 
> DNS resolution : use DNS hostname in this VNC
> DNS label:ecorpvcn >DnsDomain Name: ecorp.oraclevcn.com     
> '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 10.0.0.0/16 
- 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 : 0.0.0.0 
              > Compartment: ECorp 
              > Target Internet Gateway: Ecorp internet gateway

3- Create two Subnets (DATA & BACKUP)

 

Description

  • 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 : 192.168.78.0/24 
> Route Table: Default 
> Public subnet 
> DNS resolution: Use DNS hostname
> DNS label :data 
> DNS Domain Name: data.ecorpvcn.com
> DHCP : Default 

B– Create backup Subnet

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

III. CREATE A RAC DATABASE DEPLOYMENT

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      
       TOTAL GB : 88 
> 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 : data.ecorpvcn.oraclevcn.com
Hostname london.data.ecorpvcn.oraclevcn.com
Service Name: testDB_iad132.data.ecorpvcn.oraclevcn.com     

The result

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

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

IV. CONNECT TO THE DATABASE

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

CLOUD_RAC_INST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =publicIp1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =publicIp2)(PORT = 1521))
(LOAD_BALANCE=ON)(FAILOVER=ON))(CONNECT_DATA =
(SERVICE_NAME =testDB_iad132.data.ecorpvcn.oraclevcn.com)))

CLOUD_RAC_PDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =publicIp1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =publicIp2)(PORT = 1521))
(LOAD_BALANCE=ON)(FAILOVER=ON))(CONNECT_DATA =(SERVICE_NAME=PDB1.data.ecorpvcn.oraclevcn.com)))

Any Remark, comments ? Feel free to leave them below the article.