How do I connect to sqlplus in bash script without editing the tnsnames.ora file?

I am trying to create a bash script to run an SQL query. The issue that I have is that the connection strings that I am using below is only giving me errors.

Example connection attempts with errors:

sqlplus -s username/password@hostname:Port:SID --> ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

sqlplus -s username/password@hostname:Port/SID ---> ORA-12514: TNS:listener does not currently know of service requested in connect descriptor



Read more here: https://stackoverflow.com/questions/67391305/how-do-i-connect-to-sqlplus-in-bash-script-without-editing-the-tnsnames-ora-file

Content Attribution

This content was originally published by Tim Scott at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: