Setting Up Oracle
Before you can use Oracle you must set up an account. To do this
follow the instructions on the
TSG web page , which, in summary, is:
- Log in to one of the School's Unix servers (Tuck, Robin, etc.)
- Add oracle to your list of packages. To do this
- This assumes that you use bash, which most students are
set up to do. If you use csh or some other shell please
follow the instructions on the TSG
website
- Go to your home directory if you are not already there. You can
do this with the command
cd ~
- Edit the file .profile with your favourite Unix text
editor. For example, to edit it with emacs use
emacs .profile
- If your .profile has a line that starts
PACKAGES=
then add oracle to your list of packages. For example, if
your packages line read
PACKAGES="x11 pbm"
you would change it to
PACKAGES="x11 pbm oracle"
Note that you are looking for a line that starts
"PACKAGES=...", not "# PACKAGES=...". The first is
a line that defines your packages, the second is a comment that
gives you an example of how to define your packages. Lines starting
with "#" are comments and are ignored.
- If your .profile does not have a packages line already then add
the line
PACKAGES="oracle"
at the start of the file (or just after the comment lines which
start with #)
- Save the file and exit your editor
- Refresh your settings either by logging out then back in again,
or by using the command
source .profile
- At the command prompt type
create_oracle
You will be given a password when you do this. Remember this
password, you will need it very soon.
- You can now start Oracle's SQL interface using the command
sqlplus
- Once you have started sqlplus you can change the password
to something more memorable using the command
password
and following the online instructions.
- You can now enter SQL commands, which must end with a
semicolon, or to exit sqlplus type
exit
and press return.
Troubleshooting
If when you type sqlplus you get a message that the command cannot be
found:
This usually means that you have not set up your packages correctly in
your .profile, as described above. If you type
echo $PATH
in bash you should get a long string including the text
/cs/oracle1/app/oracle/product/10.1.0.2/bin:/cs/oracle1/bin:
If this is not in your path then the system doesn't know where to
look for sqlplus. Check that
- You have edited your .profile as described above
- You haven't just edited the comment that gives you an example of
a PACKAGES set up (the line starting with "#", see Step 2.4 for details).
- Your path isn't being redefined later in your .profile - look for
lines which look like
PATH=...
If such a line exists and doesn't inlcude $PATH in it, then
it will overwrite the old path.
- Your settings have been refreshed. To make sure of this log out
of Unix completely then log back in.
If this doesn't help, then come along to the lab times for assistance.