title: How do I connect to Oracle database link directly using SQLPLUS
body: <p>I tried each of the following - none worked:</p>
  
  <pre><code>[oracle@localhost]$ sqlplus system/oracle@SID_NAME
  
  [oracle@localhost]$ sqlplus system/oracle@localhost:1521/SID_NAME
  
  [oracle@localhost]$ sqlplus system/oracle@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=localhost)(Port=1521))(CONNECT_DATA=(SID=SID_NAME)))
  
  [oracle@localhost]$ sqlplus "system/oracle@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=localhost)(Port=1521))(CONNECT_DATA=(SID=SID_NAME)))"
  </code></pre>
  
  <p>Does SQL*Plus support direct connection to an "Oracle database link" at initial command prompt? If so - how?</p>
  
  <p><code>SID_NAME</code> does not point to a database but "Oracle database link": <a href="https://docs.oracle.com/cd/B28359_01/server.111/b28310/ds_concepts002.htm#i1007709" rel="nofollow noreferrer">https://docs.oracle.com/cd/B28359_01/server.111/b28310/ds_concepts002.htm#i1007709</a></p>
  
  <p>I am able to query the "Oracle database link" after connection to the local Oracle database. The local Oracle database is where the link has been created and points to the remote database. It connects via an ODBC DSN.</p>
  
  <p>However, I am interested in connecting to the Oracle database link directly at initial sqlplus command prompt.</p>
  
  <p>The local Oracle database port is 1521.</p>
  
  <p>The error message I get: </p>
  
  <blockquote>
    <p>ERROR: ORA-01017: invalid username/password; logon denied</p>
  </blockquote>
  
  <p>The whole point is to debug (GDB) an ODBC driver. With isql - at command prompt - I can provide the ODBC DSN and when I run <code>info sharedlibrary</code> at GDB prompt - I can see my loaded library and hence debug. I am interested in getting the driver loaded in the same way using sqlplus. I was unable to see the loaded library post connection. Hence - trying to get the library loaded at initial command just like isql.</p>
  
  <p>At what point does sqlplus actually load the ODBC driver for remote database? I know it does when a query is being executed and unloads it on exit. But I am unable to trap it - even though a breakpoint exists.</p>