I’m using the AWS Amazon Linux 2 AMI on my EC2. To download the Oracle Instant Client get the download urls for the instant client and instant client tools from: https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
Download using curl and install with rpm:
curl instant-client-url-from-page-above --output instant-client.rpm rpm -i instant-client.rpm curl instant-client-tools-from-page-above --output instant-client-tools.rpm rpm -i instant-client-tools.rpm
To connect using sql-plus:
sqlplus 'admin@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=your-instance-endpoint.rds.amazonaws.com)(PORT=1521))(CONNECT_DATA=(SID=your-db-name)))'
Enter password when prompted.
Hi Teams,
I don’t connect sqlplus like sqlplus ‘admin@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=your-instance-endpoint.rds.amazonaws.com)(PORT=1521))(CONNECT_DATA=(SID=your-db-name)))’. I want keep it tsnnames.ora file and connect the sqlplus. How to do that and where we need to create that file. please provide us the steps.
Thanks Advance.
create a directory and define a TNS_ADMIN variable. put your tnsnames.ora file there
mkdir ~/my_tns
export TNS_ADMIN=~/my_tns
touch ~/tnsnames.ora