Connecting to Remote Oracle Server with SQL*Plus in Windows

This was a huge pain at first but it turns out you just have to include the user and the connection string when you run sqlplus.exe from the command line eg:

sqlplus sys@CONNECTIONSTRINGNAME AS sysdba

And make sure your connection string is in the correct format in the “TNSNAMES.ORA” file (located in the same directory as sqlplus.exe) and your “TNS_ADMIN” environment variable is set to the directory the “TNSNAMES.ORA” file is located in. An example connection string is:

CONNECTIONSTRINGNAME =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = i.p.add.re.ss)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = DEDICATED)
)
)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>