You have:
How can you get your SQL*Plus connection going?
sqlplus user/password@(description=(address_list=(address=.......ODS)))
The text in the () is the information you would see for your service in a TNSNames file. So you can simply use the TNS entry explicitly
Note, use quotes if in Unix else the () are interpreted by the shell.
Or you can use the EZconnect syntax (my preferred method)
sqlplus user/password@//hostname/service_name
sqlplus user/password@//hostname:port/service_name
Note that for Oracle Database 12/18c multitenant architecture databases, you MUST use the /service_name and not the /SID if you want to connect to a pluggable database.
Note also that we have 2 command-line interfaces now.
SQL*Plus and SQLcl.
SQLcl is java based, and a stripped down version of Oracle SQL Developer. It supports TNS based connections, and also supports the EZConnect syntax. One significant advantage it has over SQL*Plus is that it does not require an Oracle Client installation.
This question was originally answered by Tom on AskTom.
I've updated his answer here to address Oracle 12c Multitenant and SQLcl.
If you don't want to leave password in bash history, use this:
# connect
sql user@host:port/database
# will ask password later
# then connect to your database
sql > conn database
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With