Install Oracle Database 12c on Red Hat AWS EC2 Instance — Part 1: Launching and Connecting with SSH using Putty on Windows
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)
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.
In the right side menu, navigate to the Instances. Then click to Launch Instances
Let’s look for an image of RHEL 7.9. To speed up, search directly for this code ami-0dd38e30236fe14ea , click on Community AMIs
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.
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
Finally, click on 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
There, your instance is being provisioned. At the bottom of the page, you will find a button to view this process. Click on it.
Wait a while until your Instance state is Running. Then, click on your Instance ID
Copy your instance Public IPv4 DNS (for that, just click on the icon)
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
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
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 displays a notice that the .pem file was successfully imported. Choose OK.
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.
Specify the name for the key and choose Save.
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
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 displays a security alert dialog box that asks whether you trust the host to which you are connecting. Choose Accept.
If the connection worked, your screen should look like this:
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.