Oracle at GWU


Introduction

This tutorial assumes you already have an Oracle account. Currently, Oracle runs on the machine delphi and does not run in remote-client mode, which means:

Note: your Oracle password is different from your Unix password. The rules that apply to your system password apply to your Oracle password: You are NOT to release this password to anyone else and should be careful to safeguard your password.

As an Oracle user you will be able to create and delete relations. You are welcome to try different commands. However, please don't create gobs of data. The disk space allocated to all students is limited. If you are using excessive space beyond the course requirements, your account may be dropped.


Step 1: Learning how to bring up a window from delphi

Use this set of instructions to learn how to set displays.

NOTE: for most Oracle work, you will not need to display windows remotely. However, you will need to if you are running Forms or Java.


Step 2: Setting up PATH variables

Now you should be all set to begin working with Oracle.


Step 3: Log in

  • You will be logging into delphi EVERYTIME you use Oracle. Most likely you will use telnet or rlogin from another machine.
  • There are two modes in which you will use Oracle:
    • Command-line mode. Here, you don't need X-windows. Simply telnet to delphi from wherever you are. For example, if you're on parrot:
      
      	  parrot% telnet delphi
      	 
    • X-mode. In this case, you are interested in popping up Oracle windows (such as when working with Oracle Forms or reading the on-line documentation). Then, you need to follow the instructions for bringing up a window (shown earlier).


Step 4: Read Online Oracle Documentation

(Forthcoming)


Step 5: SQL interpreter (SQLPLUS)

  • To try out SQL queries and statements, you will use a tool called sqlplus. Using this tool does not require X-windows. It is a simple command-line interpreter.
  • Type sqlplus at the command line:
    
        delphi% sqlplus
        
  • You will be prompted for a password (your Oracle Password, which is different from your UNIX password).
  • Once in sqlplus you will get the prompt
    
        SQL>
        
  • To exit, type quit.
  • To execute an SQL statement, simply type it in and end it with a semi-colon and a carriage return. For example:
    
        SQL> select * from simha.accounts;
        
    This selects all tuples from the table accounts owned by user simha. Alternatively, you can place SQL statements (as many as you like) in a file and indicate the file name. For example, suppose the Unix file test.sql contains the line select * from accounts; Then
    
        SQL> @test.sql
        
    causes the statements to be executed. Type help to get help within SQLPlus.
  • To execute a shell command from sqlplus, use ! before the Unix command. For example:
    
        SQL>!ls
        
    lists the current directory contents. You can do without this feature, but it helps you avoid going in and out of SQLPlus.


Problems?

  • The very first thing to do if you have a problem is to make sure Oracle is actually running. Sometimes, the machine is taken down for maintenance, in which case somebody has to start up Oracle again. To check, list the processes running:
    
        delphi% ps -uax | more
        
    Then look for Oracle processes that end in _osid. If you see at least two, then Oracle is running.
  • Second, make sure your paths and environment variables have been set up.
  • If nothing happens when you type sqlplus, then it means you are unable to access the binary (i.e., the /bin directory in the $ORACLE_HOME directory). Check your paths.
  • If you get sqlplus to run, but are are unable to get your password to work, something may be wrong with your account or your password is incorrect.