Monday, January 18, 2010

Connecting to Oracle

Instructions: Connecting to the Course's Oracle Database (courtesy of Demian Lessa)

In this course, you will use the SQL*Plus command line client to
interact with an Oracle 11g database. In order to connect to the
database, follow the instructions below.

1. Connect to nickelback (if you are on campus) or timberlake (if you
are off campus). For instance:

> ssh dlessa@timberlake.cse.buffalo.edu
password:

timberlake:~


2. Define the environment variables ORACLE_HOME and TWO_TASK:

timberlake:~ setenv ORACLE_HOME /util/oracle/product/current/
client_1
timberlake:~ setenv TWO_TASK aos.buffalo.edu


3. Start SQL*Plus. You will be prompted for credentials. Use your UBIT
user name (the same you used to log on in step 1) for user-name and for
your password, choose either cse462r1 or cse462r2, according to the
recitation which you registered for.

timberlake:~ sqlplus

SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jan 18 12:58:18 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.

Enter user-name: dlessa
Enter password:

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

SQL>


4. Because all passwords are standard, you should change your password
as soon as you login. Simply type 'password' on the command prompt and
provide the old and new passwords as requested:

SQL> password
Changing password for DLESSA
Old password:
New password:
Retype new password:
Password changed

SQL>


5. In order to close your SQL*Plus session, type 'quit' on the command
prompt:

SQL> quit

Disconnected from Oracle Database 11g Enterprise Edition Release
11.1.0.7.0 - 64bit Production with the Partitioning, OLAP, Data
Mining and Real Application Testing options

timberlake:~


For further information, refer to the CSE wiki Oracle page:
If you still cannot get it to work, stop by my office hours.

Regards,

Demian Lessa

1 comment:

  1. You might have to do the setenv every time you log in to the system. To have it execute by itself every time you log in add these lines:
    setenv ORACLE_HOME /util/oracle/product/current/client_1
    setenv TWO_TASK aos.buffalo.edu
    to the file .login, which should be located in your home folder.

    -Sirak Gizaw

    ReplyDelete