Setup sqlplus for AWS RDS Oracle DB in a Linux server

Step 1 : 

Download the packages


URL : https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html


We need below 2 files. 


instantclient-basic-linux.x64-23.8.0.25.04.zip
nstantclient-sqlplus-linux.x64-23.8.0.25.04.zip


The version of above packages can be changed. 


Make a new dir for the oracle configurations and extract the 2 zip files in the same location.


mkdir -p /root/oracle/instantclient_23_8



Step 2 :


Create  tnsnames.ora file


touch /root/oracle/instantclient_23_8/network/admin/tnsnames.ora


Content is below


service name =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = maleesha-lr.c700eh08fac4.eu-west-2.rds.amazonaws.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = service_name)
    )
  )


Step 3 :


Set env variables for the linux user in the bash profile 


export ORACLE_HOME=/root/oracle/instantclient_23_8
export PATH=$ORACLE_HOME:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin

Step 4 :


Install libaio


sudo dnf install -y libaio

Step 5 :


Test the connection


source ~/.bash_profile

sqlplus username/password@service_name



Maleesha Gimshan | 21st June 2025


Comments

Popular posts from this blog

ArgoCD Installation

Linux File Permissions – Quick Short Note