Of course, SQL*Plus is useless if you can’t connect…

Can’t connect to your Oracle database like I couldn’t all freakin’ morning? Grrr. I think what I really couldn’t connect to was my tnsnames.ora file. I still have no idea how to get that to work after all these years. But this page explains how to put the connect string on the command line. And that just plain works.

In short, instead of depending on a tnsnames.ora file, you can use a command of the form:

    sqlplus username@'(annoying connect string here)'

On Windows, use double quotes:

    sqlplus username@"(annoying connect string here)"

It’s ugly to be sure, but it gets the job done. And it fits on a single line of some hunk of documentation that you (that is to say, I) have to write, and doesn’t rely on any installation dependent tnsnames.ora file.


Leave a Reply

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