When using the RDS Console to provision an Oracle RDS database we are given the option under Connectivity to ‘Connect to an EC2 compute resource’
This short blog will explore utilising the Connect to an EC2 compute resource option

Step 1: Provision an EC2 Instance and install the Oracle Client
- Navigate to the EC2 Console and Select Launch instance

We will use the below options
Option | Value |
---|---|
Name | rdsconnect01 |
Amazon Machine Image (AMI) | Amazon Linux, Free Tier eligible |
Architecture | 64-bit (x86) |
Instance type | t2.micro, Free Tier eligible |
Key pair (login) | Create new key pair Key pair name: rdsconnect01 Key pair type: RSA Private key file format: .pem Create key pair |
Network settings | review : vpc, subnet, public IP accept defaults or change if needed |
Create security group | Allow SSH traffic from 0.0.0.0/0 (public), can restrict if needed but this is just a test |
Configure storage | change default root volume 1 x 50 GiB gp3 |
Advanced details | Ignore |
EC2 will take 5 Minutes to create
Once EC2 has been provisioned select Server on EC2 Console and connect


Step 2 : Install Oracle Client
Open a web browser and goto : Instant Client for Linux x86-64 (64-bit)
Choose the Latest 19.x and Basic Package (RPM), copy the download url such as :
On the EC2 use the above URL to download the file to the host
you will be logged in as ec2-user in home directory /home/ec2-user
curl -O https://download.oracle.com/otn_software/linux/instantclient/1926000/oracle-instantclient19.26-basic-19.26.0.0.0-1.x86_64.rpm
curl -O https://download.oracle.com/otn_software/linux/instantclient/1926000/oracle-instantclient19.26-sqlplus-19.26.0.0.0-1.x86_64.rpm
sudo yum install oracle-instantclient19.26-basic-19.26.0.0.0-1.x86_64.rpm
sudo yum install oracle-instantclient19.26-sqlplus-19.26.0.0.0-1.x86_64.rpm
If we need add the below to our path we can run sqlplus, not the version is in the path so if you downloaded a different version of the rpm your path will be different
export PATH=/usr/lib/oracle/19.26/client64/bin:$PATH
Step 3: Provision and Oracle RDS database and connect to an EC2 resource
Navigate to the RDS Console and use below options
Option | Value |
---|---|
Choose a database creation method | Standard create |
Engine type | Oracle |
Database management type | Amazon RDS |
Edition | Oracle Standard Edition Two |
License | License Included |
Engine version | Use Latest (default) |
Templates | Dev/Test |
Settings | Accept Defaults |
Credentials Settings | Accept Defaults |
Instance configuration | Burstable classes (includes t classes) db.t3.small |
Storage | Accept Defaults |
Availability & durability | Do not create a standby instance |
Connectivity | Connect to an EC2 compute resource |
EC2 instance | rdsconnect01 (The instance we created above) |

DB Subnet, Public access, Security Group | Accept Defaults |
Tags | skip |
Database authentication | Accept Defaults |
Monitoring | Accept Defaults |
Additional configuration | Initial database name : ORCL |
DB parameter group, Option group , Character set | Accept Defaults |
Backup | Accept Defaults |
Encryption | Accept Defaults |
Maintenance | Accept Defaults |
Database will take 10 Minutes to create
Step 4: Obtain admin password
While Database is creating we choose to store the admin password in AWS Secret Manager, navigate to Secret Manager Console > Secrets > select Secret name rds<random hash>

Click on the URL then Retrieve secret value and copy the password to be used to test connectivity

Step 5 : Test connectivity from the EC2 to Oracle RDS database
From the RDS Console select our database we have created and select ‘Connectivity & security’, make a note of :
- Endpoint
- Port (should be 1521 default)
Next Navigate to ‘Configuration’ make a note of:
- DB name (should be ORCL)
using this information we can form our database connection string which has a format of:
- //host[:port][/service_name]
- as an example : //database-1.cekqbdsf234u.eu-west-2.rds.amazonaws.com:1521/ORCL
ensure path env variable is set to use sqlplus (mentioned above in Step 2)
Now using the username (admin) + password (in secret manager) + connection string we can test a connect to the database as below:
sqlplus admin/'<password encased with single quotes>’@////host[:port][/service_name]:1521/ORCL
(I’ve blacked out some of IP, Password, Endpoint for security)
