Oracle 12c Installation on Amazon EC2 — RHEL8 (Silent Installation)

Avani Jhala
7 min readOct 4, 2023

--

Below are the step-by-step instructions (with a screenshot) to install Oracle 12c software on the Amazon EC2 instance.

1: Create EC2 instance: Go to AWS console -> EC2 -> Launch Instance -> Give Instance Name

2: Select AMI as per your requirement. Here I’m using RHEL 8.6 for this practical.

3: Select Instance Type. Amazon instance types are basically combinations of CPU, memory, storage, and networking capacity which gives flexibility to use those facilities based upon our requirement and pay as per your need. Here I’m using t2. medium instance type with 2vCPU and 4 GiB of Memory is sufficient for performing this practical.

One needs to choose the instance type based on the organization’s needs and usage.

4:

Click on Create New key pair to generate the key pair.

5:

Give the name of the Key pair -> Select type “RSA” and Private key format as “. pem”

6: Create a Security Group.

Go to AWS console-> Network & Security -> Security Groups -> Click on Create Security Group.

7: Give the Security group name and description.

Add an inbound rule, and open port 22 for SSH & port 1521 for Oracle, as of now I opened all the IP ranges for demo purposes but in real time scenario, the Database server is not directly accessible from the internet, it should be accessible via NAT gateway & Bastion host.

Allow all traffic for Outbound Rule.

8. Configure storage -> 10GiB for OS and an additional 20 GiB EBS volume for Software and Database Installation.

Then click on Launch Instance.

9: Now when you go to the dashboard -> Instances, your newly created instance is up and running.

10:

To connect to your instance from your computer, you need the public IP address of your EC2 instance. If you click on Instance ID (Highlighted in the Blue Color link) you will get detailed information about your instance.

From here you need to copy the Public IP of your instance:

11:

Go to your local machine and open a new terminal. Go to your Downloads to find your private key file required to log in to your EC2 instance.

Type below command to log in to your EC2 instance.

$ ssh ec2-user@<Public IP address of EC2> -i<Private key file name>

Now you have successfully logged into your EC2 instance.

12: Install Zip & WGET Packages.

13: Now we need to Install the required rpm and for that follow below steps:

Go to yum.oracle.com -> select Oracle Linux 8 under the browse repositories section -> AppStream Latest -> select x86–64 -> Type database in search bar -> Right-click and copy the link for “oracle-database-preinstall-19c-1.0–1.el8.x86_64.rpm”

14: Download RPM on the EC2 server using WGET.

15. Install the RPM.

When you type “id oracle” after the installation, you can see Oracle groups and users have been created.

16. Now we need to download Oracle Database Software. Below are the steps to do the same.

Go to edelivery.oracle.com -> login to your account -> type oracle database 12c in search bar ->

Click on 12c 12.2.0.1.0 -> click on View Items -> Continue -> Only check Oracle Database -> select Linux x86–64 from Platforms/Languages drop down menu -> Continue -> Accept the agreement -> continue -> select WGET options -> Click on Download.sh button

17. Now we have Download.sh file on our local machine. Open the file and copy its content. Go to your EC2 instance, create a file called Download.sh (With vi editor) and paste that content into it and save it.

18. Execute the Download.sh file.

Now we have Oracle database software Zip file with us. See the below image.

19. We need to first mount the EBS volume before using it

20. Create a directory to install Oracle Software. Oracle recommends to follow a standard Oracle directory structure so it would be easy, however, you can create based on your organization’s best practices as well.

Here I’m creating a directory named “Avani” where I’m going to install my Oracle Software.

Copy the software Zip file to Directory “Avani”

21. Change the ownership of the Directory from Root to oracle:oinstall Group/user.

22. Here I’m changing the hostname to “AvaniServer”

23. Switch the user from Root to Oracle → Go to /Avani and unzip the Oracle software zip file.

24. After unzipping we can see the folder “database” has been created.

25. Now I’m going to install Oracle Software in Silent installation mode with a response file. However, to do that first I need to make a few changes in the response file as per the requirement.

You can find the response file under /database/response with the name db_install.rsp.

I’m going to copy the response file to my home location and then modify it.

26. Open the db_install.rsp file in the vi editor and make the following changes.

Note: I’m only making basic changes that are required for basic installation for this demo. One needs to change the response file as per the organization’s needs/requirements/architecture.

oracle.install.option=INSTALL_DB_SWONLY

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION= /Avani/oraInventory

ORACLE_HOME= /Avani/dbhome_1

ORACLE_BASE= /Avani/oracle

oracle.install.db.InstallEdition=EE

oracle.install.db.OSDBA_GROUP=dba

oracle.install.db.OSBACKUPDBA_GROUP=dba

oracle.install.db.OSDGDBA_GROUP=dba

oracle.install.db.OSKMDBA_GROUP=dba

oracle.install.db.OSRACDBA_GROUP=dba

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

DECLINE_SECURITY_UPDATES=true

27. Create the following directory before starting the silent installation.

28. Go to /Avani/database and execute the following command to initiate the silent installation of Oracle Software.

./runInstaller -silent -responseFile /home/oracle/db_install.rsp -ignoreSysPrereqs -skipPrereqs -showProgress

29. Oracle Database Software Installation has been completed. Now run those two .sh scripts as Root user.

30. After this, you should be able to connect to an idle database instance.

Your Oracle Database Software Installation is successfully completed!

Click Here to get the detailed steps for Oracle 12c database creation (Silent Creation) on AWS EC2.

If you find value in the knowledge shared, your applause on my post would be greatly appreciated!

Keep Learning!

--

--

Avani Jhala

Talks about #awscloud, #database, #posgresql, #oraclecloud, and #performancetuning