Install Oracle Database 12c on Red Hat AWS EC2 Instance — Part 1: Launching and Connecting with SSH using Putty on Windows

Luiz Eduardo Zappa
5 min readSep 4, 2021

--

I gave myself the challenge to install Oracle Database only with command line (silent mode) on Red Hat (RHEL 7) AWS EC2 Instance. I had some difficulties throughout the process, and found the solutions in a very fragmented way on the Web, so I decided to gather everything I learned and write this article in a very detailed way (from setup an AWS EC2 Instance, connecting with SSH, sending files there,… to create an instance and pluggable database). I wish I had found such a step by step like this, I hope it helps someone.

As it got too big, I divided the article into some parts. It looked like this:

Part 1 (This article): Launch AWS EC2 Instance with RHEL 7 and connect with SSH (Windows using Putty)

Part 2: Setup Red Hat to receive the Oracle Database installation

Part 3: Download Oracle 12c and transfer to AWS EC2 instance with Secure Copy Client (SCP)

Part 4: Install Oracle Database and Create Instance

Install Oracle Database on RHEL 7 AWS EC2 Instance

The first thing we should do is launch an Amazon EC2 instance with the RHEL 7 (Red Hat Enterprise Linux) image. Let’s go to AWS Amazon Console, sign in, on the home screen, click on services, under compute category, click on EC2.

AWS Console — Accessing EC2 service

In the right side menu, navigate to the Instances. Then click to Launch Instances

AWS EC2 — Launch New Instance

Let’s look for an image of RHEL 7.9. To speed up, search directly for this code ami-0dd38e30236fe14ea , click on Community AMIs

AWS EC2 — RHEL 7 Image

I chose a type eligible to Free tier, but feel free to choose your configuration. Then click on step 4: Add Storage, at the top of the screen.

AWS EC2 —Choose Instance Type

Just to install Oracle Database, we need almost 7GB, so we should increase the default storage capacity. 30GB is enough (remembering that the Free tier holds up to 30GB). Then click on Review and Launch

AWS EC2 — Add Storage

Finally, click on Launch

AWS EC2 — Launch

We need to create one Key Pair to be able to access the instance with SSH. Choose a name that is intuitive for you, I chose rhelserv . Click on Download Key Pair and store this file (don’t lose it, otherwise it will be necessary to generate another one). Then click on Launch Instances

AWS EC2 — Creating Key Pair

There, your instance is being provisioned. At the bottom of the page, you will find a button to view this process. Click on it.

AWS EC2 — Provisioning

Wait a while until your Instance state is Running. Then, click on your Instance ID

AWS EC2 — Instances Running

Copy your instance Public IPv4 DNS (for that, just click on the icon)

AWS EC2 — Instance Public IPv4

Now we are going to connect via SSH. As my operating system is Windows, I will use PuTTY. Other systems have this feature built in. Access PuTTY Mirror and download these files: putty.exe , pscp.exe and puttygen.exe

Download PuTTY

PuTTY does not support the private key format for SSH key (.pem file downloaded). So, we will use the tool PuTTYgen to convert the required format (.ppk). Open PuTTYgen (puttygen.exe), under Type of key to generate, choose RSA, then click on Load

PuTTYgen — Convert .pem to .ppk

By default, PuTTYgen display only files with the extension .ppk . To locate your .pem file, choose the option to display files of all types. Then open the .pem file downloaded before

PuTTYgen — Open .pem file

PuTTYgen displays a notice that the .pem file was successfully imported. Choose OK.

PuTTYgen — Successfully notice

Then choose Save private key. PuTTYgen displays a warning about saving the key without a passphrase. Choose Yes.

A passphrase on private key is an extra layer of protection. Your private key can’t be used without the passphrase. The downside to using a passphrase is that it makes automation harder because human intervention is needed to log on an instance.

PuTTYgen — Save private key

Specify the name for the key and choose Save.

PuTTYgen — Save generated private key

Let’s connect to our AWS EC2 instance. Start your PuTTY (putty.exe), in the Category pane, choose Session and complete the following fields:

Public DNS: paste your Public IPv4 DNS copied a few steps back.

Port: 22

Connection Type: SSH

PuTTY — Session configurations

In the Category pane, expand Connection, expand SSH, then choose Auth. Complete the following:

Choose Browse. Then, selected the .ppk file that we generated and choose Open.

It’s important that we save these settings for future use. Under Category pane, choose Session, enter a name for the session in Saved Sessions, then choose Save. Then, we can click on Open.

PuTTY — Save configurations for future use

PuTTY displays a security alert dialog box that asks whether you trust the host to which you are connecting. Choose Accept.

PuTTY — Security alert for the first connect

If the connection worked, your screen should look like this:

PuTTY — Connected Successfully

We were able to connect to the instance with SSH. In the next article (Part 2) we will prepare Red Hat for installing Oracle Database.

--

--

Luiz Eduardo Zappa

Engineer breaking into the world of information technology 👨‍💻 I comment on what I'm developing on https://twitter.com/imluizzappa