Oracle Spin

Day-to-Day Experiences

How to pass host, port, SID/Service name to connect to a database?

Posted by Amin Jaffer on October 7, 2008

Using the following command one can pass hostname, port, servicename and SID and connect to a database without having an entry in tnsnames.ora

$ sqlplus username/password@hostname:port/SERVICENAME

OR

$ sqlplus username
Enter password: password@//hostname:port/SERVICENAME

OR

$ sqlplus /nolog
SQL> connect username/password@hostname:port/SERVICENAME

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>