Connecting to Oracle on Nias

Introduction

This is only a brief set of notes - I wrote a much longer and more detailed document but my web directory on nias has since disappeared.

Rationale

Using the Oracle client (sqlplus) on nias allows you to connect to Oracle from any machine that can connect to nias (such as your home machine if you have internet access). No more waiting for a computer in a lab (and you can edit your queries in vi).

Setup

You need to add a directory to your path and set a few environment variables. You will probably want to put this in your .cshrc/.tcshrc/.profile as appropriate.

For a C based shell (csh, tcsh et al):


	set path=($path /ora/app/oracle/product/8i/bin)
	setenv ORACLE_SID INT
	setenv ORACLE_HOME /ora/app/oracle/product/8i

Running sqlplus

To connect just run sqlplus. You should be asked for your username and password. If you get those correct you should be able to type and run straight SQL.

Read the help to work out how to run scripts etc. I don't have an Oracle account so I can't do that for you.

Some handy queries for you:


	SELECT table_name FROM user_tables;

That will show you all the tables you own.


	DESCRIBE table_name

That will show you the structure of a table.