Easy Connect and sqldev.conn issues
PaoloMMay 11 2012 — edited May 31 2012Hello everybody,
while trying to add SQL*Plus as an external tool in SQL Developer 3.1, I noticed something very weird.
When using the *${sqldev.conn}* macro in the Arguments field, I noticed that it will return a different result depending on how the DB connection was defined.
If I define a DB connection with Connection Type = Basic, then *${sqldev.conn}* will return a string like "*server:port:SID*", while if I define the connection as TNS (thus referencing an existing entry in my tnsnames.ora), then ${sqldev.conn} will return the ENTIRE string stored in the tnsnames file for the active DB instance. I believe that a DB connection using "Custom JDBC URL" will return exactly the URL you enter (jdbc:oracle:thin...etc.), while I do not have an LDAP setup to verify what it will spit out in that case.
I think that this kind of behaviour is a little unpredictable and that not all the external tools will understand the different kind of strings returned by ${sqldev.conn}, like it's the case with SQL*Plus. Anyway knowing it in advance will make it easier to choose how to define your DB connection, but of course this behaviour is not documented anywhere (please correct me if I am wrong).
Now the main problem is that with a Basic connection type, I would expect SQL Developer to return an EasyConnect string, so that the external tool can directly understand it (assuming that your sqlnet configuration is correct), while this is not the case. You can easily verify that with Basic connection type, the *${sqldev.conn}* macro returns "*server:port:SID*" (that is NOT understood by Sql*Plus), while the correct Easyconnect syntax would be "*server:port/SID*" (note the slash in place of the last colon).
Did anybody else see this bug? Can it be fixed in the next release?
Currently to workaround the issues above, I will have to:
1) redefine all my DB connections to use the Basic connection type;
2) write a DOS batch script wrapper that does some black magic to convert "server:port:SID" string to an Easyconnect compatible string and pass it to Sql*Plus;
but I would very much appreciate a built-in solution that makes your life easier at least with Sql*Plus.
Any comments?
Thanks,
Paolo
Edited by: PaoloM on 16-mag-2012 10.04