Friday, November 4, 2011

Logging into oracle from SQL Plus without TNS entry

I got this from Ask Tom
very userful for quick logins / checks
>sqlplus "myuser/mypasswd@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=192.168.0.20)(PORT=1521))
(CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=orcl11g)))"
Be careful with extra spaces and extra parentheses. In Windows use double quotes "

This can also be done in a shorter way like this:
>sqlplus "myuser/mypasswd@192.168.0.20/myserviceName"