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.

SQL*Plus Installation made easy.

If you’ve every tried to install Oracle on any UNIX/Linux system, you know what pain is — especially if all you want is the SQL*Plus client software.

Edit: This page does a better job of explaining it. (I think the page at Oracle’s site changed since I originally wrote this.)

What has also changed is that Oracle now provides the client software in its own downloadable package. You have to install a few additional libraries on Linux, but that’s not too tough.

Here’s a page that describes how to download and install SQL*Plus in a few relatively simple steps.