The query timed out at 3 a.m., the pager still buzzing in my hand. Dead silence from the app. The Oracle database was fine. The AWS instance was fine. sqlplus was dead.
This is the moment you remember: connecting AWS to sqlplus is a minefield if you miss a single switch. The good news? It’s simple when you see the whole map.
Step 1: Make sure your AWS instance can talk to Oracle
Check the Security Group rules. Add inbound rules for TCP port 1521 to the correct source. If you’re using a private subnet, verify the NAT Gateway and route table.
Step 2: Install sqlplus inside your AWS environment
On Amazon Linux or Ubuntu, install Oracle Instant Client.
sudo yum install libaio
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linux.x64.zip
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sqlplus-linux.x64.zip
unzip instantclient-basic-linux.x64.zip
unzip instantclient-sqlplus-linux.x64.zip
export LD_LIBRARY_PATH=/path/to/instantclient:$LD_LIBRARY_PATH
Keep paths clean. Put exports in .bash_profile so they persist.
Step 3: Verify connectivity
Run: