Friday, March 01, 2013

SQLPlus connection without tnsnames.ora

You can connect using sqlplus with user/pwd@tnsname, or with tnsname string directly as:



sqlplus  user/pwd@'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<host>)(PORT=1521)))(CONNECT_DATA=(SID=<sid>))'


This is cumbersome, and has a lot of problem on unix, since brackets "(" and ")" need backslashes.   Since Oracle 10g, there's a better way:  
  
sqlplus user/pwd@//host:1521/sid



I feel it's very useful, so noted down for future use.

2 comments:

Anonymous said...

This will also work

sqlplus username/password@ip-address:port/DB_NAME

Unknown said...

The support and services that are rendered by the technicians at Gmail support number 1-888-306-5155 evoked by the endeavor to exceed expectations as well as to perform better with a deliberate and dependable approach that doesn't take after the trial method for foxing the mistake makes the outcomes more solid and guaranteed.
The Technicians who we contract are prepared with the apparatus so nothing goes out of order with regards to demonstrating the outcomes that befits the arrangement.