Oracle Usage

Accounts on Oracle (11GR2, latest 64 bit version) for everybody in the class with wpi accounts will be created.
For documentation, remember to visit: http://otn.oracle.com.

You need to follow the steps below in order to use the Oracle command_line interface, i.e., sqlplus, which is available on the CCC machines.


0. You do:

First, you need to login to a ccc machine (such as, ccc.wpi.edu) with your Unix or your Windows password.

At your shell prompt (set to tcsh), you type in: source /usr/local/bin/csoraenv

Or, alternatively, at your shell prompt (with shell set to /bin/bash), you type in: source /usr/local/bin/oraenv

or, alternatively, you could link the file in permanently by: ln -s /usr/local/bin/coraenv coraenv

This would create a soft link linking a file "coraenv" in your home directory to an oracle initialization file located at /usr/local/bin/. You only need to do this ONCE to create the file "coraenv".

Or, alternatively, you can also create a file yourself called ".cshrc", with the content:

setenv PATH .
setenv ORACLE_BASE /usr/local/oracle
setenv ORACLE_HOME /usr/local/oracle11gr2/product/11.2.0/db_1
setenv PATH ${PATH}:${ORACLE_HOME}/bin
setenv ORACLE_SID cs
setenv TWO_TASK ${ORACLE_SID}

But if you do above, you need to be very careful so not to put any extra blanks or other end-of-line symbols into your .cshrc file.

For the other steps, namely steps 1~4 below, you need to do them every time when you want to connect to Oracle.

1. Login to ccc.wpi.edu:

ssh ccc.wpi.edu

2. Source the Oracle environment initialization file:

source coraenv

Or, alternatively, you could also have done
source .cshrc

This runs the initialization file that sets up some environment variables for Oracle. If it prompts "ORACLE_SID = [xxx]" where "xxx" is not "CS", answer "CS". If it prompts "ORACLE_SID = [CS]", just hit the ENTER key.

In 2011, we have oracle version of 11GR2g. The path is:/usr/local/oracle11gr2/product/11.2.0/db_1/bin

3. You now can start using Oracle by typing:

sqlplus

You should get the response like:

[rundenst@CCCWORK3 ~]$ sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Mon Sep 12 09:53:53 2011
Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: rundenst
Enter password: xxxx

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[rundenst@CCCWORK1 ~]$

4. Provide your username and password:

input your ORACLE USER NAME AND PASSWORD, as mentioned in class.

Once you sare be at the SQL-Prompt, you are able to create tables, etc. We suggest you to change your password immediately after you login to Oracle for the first time, by issuing the command passwd at the SQL prompt.

5. NOTE: If you are using some Oracle client software, the tnsnames.ora entry for this Oracle server instance is:

CS =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(Host = oracle.WPI.EDU)(Port = 1521))
    )
    (CONNECT_DATA =
      (SID = CS)
      (SERVICE_NAME = CS.WPI.EDU)
    )
  )