|
There are a number of client programs that allow you to interactively
issue SQL statements to Oracle. Here is some information about a few of
them.
- sqlplus The sqlplus program is Oracle's terminal-based command-line
SQL interface. The advantage of using sqlplus is that it is very easy to
get started: (1) Log onto one of Stanford's UNIX machines, (2) type
"source /usr/class/cs345/all.env", (3) type "sqlplus", (4) enter your
username and password when prompted, (5) type in a SQL statment, terminated
with a semicolon. The disadvantages of sqlplus is that it is very clunky,
has poor text editing capabilities, and does a horrible job formatting large
query results.
- TOAD TOAD
is a free Oracle client program for Microsoft Windows.
The advantage of using TOAD is that it has a nice graphical interface and is
easy to use. The disadvantage of TOAD is that you have to do a bunch of work
to install it and set it up before you can start using it.
- TOra TOra is a free,
open-source Oracle client program for Linux
and Windows. TOra is very similar to TOAD and has the same advantages and
disadvantages.
If you own a Windows or Linux computer that you use for schoolwork, installing
TOAD or TOra is recommended, because it will probably make your life easier
in the long run. However, it is possible to get by with sqlplus if you don't
want to put up with the hassle of installing one of the other programs.
Here are the steps to install TOAD (TOra is similar):
- Download TOAD and
uncompress it into some directory.
- Download the Oracle Instant Client, "Basic" package, for the
appropriate platform (Windows or Linux). You will have to register with
Oracle TechNet to do the download, but it's free of charge.
- Create an "oracle" directory on your computer with subdirectories
name "bin" and "network". Within the "network" directory create a
subdirectory called "admin".
- Uncompress the Oracle Instant Client package and place its contents in
the "bin" subdirectory.
- The next two steps are for installing TOAD. If you're installing TOra,
then read this instead.
- Run the "regedit" Windows program (e.g. select "Run" from the Start menu
and type "regedit"). Under the key HKEY_LOCAL_MACHINE/SOFTWARE, create
a new key named "ORACLE". Under the "ORACLE" key, create a String value
named ORACLE_HOME and set its value to be the path to the "oracle" directory
you created earlier. (See this page for more details.)
- Add these environment variables (in Windows XP, go to the Advanced tab
under "My Computer"): SQL_PATH=the path to your oracle directory,
LD_LIBRARY_PATH=the path to your oracle directory, TNS_ADMIN=the path to your
oracle/network/admin subdirectory.
- Copy the file tnsnames.ora from /usr/class/cs345/sqlnet to your own machine
and place it in the oracle/network/admin subdirectory.
After following the above steps, you should be able to run TOAD -- contact
the instructor if you have problems.
|