This post covers How To Create Database on Oracle’s Gen2 Cloud (OCI) on VM Database.
Note: There are different types of DB systems in the Oracle Cloud To know more about Oracle Cloud Database Deployment Options (VMDB, BMDB, ExaCS, ExaCS & Autonomous (ADW, ATP), check here https://k21academy.com/clouddba58
Note: This post is part of Video series of Roles and Responsibility or Tasks of DBA, if you haven’t seen my previous post then click on the link to watch the previous video post-https://k21academy.com/clouddba12
Database Deployment
In Oracle Cloud, there are two deployment models in User-Managed Database i.e., Database in Public Subnet or Database in Private Subnet where Subnet is a part of VCN
Note: To know more about VCN, Subnet, Firewall (Security List), IGW, DRG & how to create it, check here https://k21academy.com/oci63
1) Database Deployed Inside Private Subnet
Database Host on a private subnet listen on a Private IP, We recommend the Deploying database on a private subnet & you will be able to access the database within the Virtual Cloud Network. You can access it from the on-premises network via DRG (Dynamic Routing Gateway) using either FastConnect or IPSec VPN
2) Database Deployed Inside Public Subnet
A database running on Public Subnet will get both Private IP & Public IP, you will be able to access it via Public IP & Internet Gateway is required for connectivity.
We only recommend creating a database on the public subnet only when you are using this database for testing purposes or if you want to expose your database to the internet.
How to Create Database on Oracle Cloud
1) Register & Log into the Oracle Cloud account, cloud.oracle.com
Note: First, you should have an Account at Oracle Cloud and if you don’t have one, then you can register FREE using my step-by-step video & guide that I covered in episode 30. You can get it by visiting https://k21academy.com/cloud01
2) Configure Network: Next, as we want to access the database over the internet, so we’ll create it in the Public Subnet and assign Public IP in addition to configuring Internet Gateway on VCN.
Note: If you are not familiar with VCN, Subnet or Internet Gateway then learn about them in one of my previous episodes on networking at https://k21academy.com/oci63
3) Generate SSH Keys: Once you are done with creating VCN & Public Subnet, then you also need one more thing i.e. SSH Keys Pair that you generate using Puttygen, so that you can access the Autonomous Linux using SSH private key.
Note: If you are new to SSH Keys or don’t have one, to create SSH keys Check at https://k21academy.com/oci51.
4) Sign In: Once you have all the things sorted, sign in to Oracle Cloud Account, and you will land on the OCI Console.
5) Create Database Instance: Click on the hamburger menu on the top left side, select Bare metal, VM & Exadata & then Click on Create DB System.
6) First, select the Compartment in which you want to create the Database.
Note: If you want to know more about the Compartments and Policy, check our post here http://k21academy.com/oci21
7) Enter the name of DB System, Then choose Availability Domain inside which you want to create the Instance, If you want higher CPU & higher memory, then click on “Change Shape“.
Note: Want to know more about Region & Availability Domain in OCI, then click herehttps://k21academy.com/oci27
8) Under “Add Public SSH key”, Copy the content of SSH Public key.
Note: If you are new to SSH Keys or don’t have one, to create SSH keys Check at https://k21academy.com/oci51.
9) Select the VCN & Public Subnet, then click on Next
10) Enter the DB Name, & select the Database version. Create the SYS admin password (make sure you remember the password)
Note: The password must be nine to thirty characters and contain at least two uppercase, two lowercase, two numeric, and two special characters. The special characters must be _, #, or –
11) When the database creation is complete, the status changes from Provisioning to Available
Note: It will take 50-60 minutes to make your instance up & Running
How To Connect
1) In order to connect to Database Host deployed in Oracle Gen2 Cloud (OCI), you need to open port 22, which is SSH port and you will be able to connect to your database Instance and In case you want to connect to database listener port you have to open port 1521, so that your application will be able to talk to the database or other services over internet.
Note: When you create VCN using default options various resources are by default created by Oracle (Security List, IGW, Route Table).
To know how to create a security list and open port in Oracle Gen2 Cloud check here https://k21academy.com/oci63
2) To connect to the Instance you will need the Public IP of the Instance & the PuTTY Software
Note: To know how to get the Public IP of the Database, check here https://k21academy.com/clouddba47
Enter the Public IP Address in the Hostname, then add the SSH Private key (That we created before) under SSH & then Auth. Click on “Open”
Troubleshooting
So that’s all how you can create and provision Database on OCI. Now, some of you might face issues while connecting the instances.
There could be multiple reasons of Instance Connectivity issues in OCI like:
- Issue 1: In the Security List SSH port 22 (Linux) is not open.
- Issue 2: Internet Gateway (IG) is not configured.
- Issue 3: SSH Public key you generated was not uploaded properly while creating the instance (or you are not using Private Key Properly in Putty).
- Issue 4: You have forgotten to add the Private key under SSH->Auth
- Issue 5: It could be a typo issue for username
For the Fixes of the above issue, you can check our previous post [Troubleshooting] Compute (Linux/Windows) & Database Instance Connectivity Issue in Oracle Cloud (OCI),
check here https://k21academy.com/oci45
Related/Further Readings
- Oracle Cloud: Create VCN, Subnet, Firewall (Security List), IGW, DRG: Step By Step
- Oracle Cloud Database Options (VMDB, BMDB, ExaCS, ExaCS & Autonomous (ADW, ATP)
- How to Get Public IP of Database In Oracle Gen 2 Cloud (OCI)
- [Video] Oracle Autonomous Data Warehouse Cloud Service 18c Now on OCI
- [Troubleshooting] Compute (Linux/Windows) & Database Instance Connectivity Issue in Oracle Cloud (OCI)
Next Task For You
Begin your journey towards becoming a Cloud DBA Expert by joining the FREE MasterClass.
Click on the below image to Register for the FREE Masterclass Now!
Join FREE Community [Oracle Cloud DBA]
The post How To Create Database on Oracle’s Gen2 Cloud (OCI) appeared first on Oracle Trainings.