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)
)
)