Pages

Wednesday, June 20, 2012

How To Connect database in sqlplus without tnsnames.ora

Many times we have requirement of connecting database to execute a sql script but we sometimes don't find the tnsnames.ora file and sometimes we don't have permission to edit (one of my client faced issue on Windows 2008 Server).

So to avoid this issue we can connect to any DB using below string directly without using any tnsnames.ora file.

sqlplus "SCOTT/TIGER@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=OR2)(PORT=1521))(CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=DEV)))"

 Note in UNIX put the single quote instead of double quote

No comments:

Post a Comment