This page is deprecated. Please go here instead.

Oracle 9i

Date of last revision: 04/17/2007

Oracle is a relational database.

Oracle 9i help index:


Availability

Currently Oracle is only available on bajor.

To access bajor, type the following command:

rlogin bajor

Preparation

At bajor, type the following command to start oracle:

setup oracle9i

See "helpme setup" for information on finding out what versions are available or what to do if the setup statement does not work.


Running Oracle 9i

After setup oracle, the command "sqlplus" will run a command-line-based SQL interface.

When being asked for user name and password, your user-name is the same as your Unix username, and your initial password is also your username. For example:

Enter user-name: <your DC username>
Enter password: <your DC username again>

Students are encourged to change their passwords at first time login.

To change password, type either "passw" or "password".


JDBC / Web Access

The following parameters should be used when setting up JDBC or other web-based access to the Oracle database.

Driver type  Thin
Host	     bajor.engr.scu.edu
TCP Port     1521
SID	     db9i
DB name	     your oracle username
DB password  your oracle password

To open a connection to database, use the static getConnection() method of the JDBC DriverManager class. This method returns an object of the JDBC Connection class which needs as input a userid, password, connect string that identifies the JDBC driver to use, and the name of the database to which you want to connect.

Connecting to a database is a step where you must enter Oracle JDBC driver-specific information in the getConnection() method.

The following example connects user scott with password tiger to a database with SID db9i through port 1521 of host bajor.engr.scu.edu, using the Thin driver:

Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn =
  DriverManager.getConnection ("jdbc:oracle:thin:@bajor.engr.scu.edu:1521:db9i",
    "scott", "tiger");

NOTE: When building/testing your JDBC application from the command-line, you must first type 'setup jdk' to put the proper JDK (with Oracle JDBC driver support) into your PATH. If you do NOT run 'setup jdk' first, you will get the locally installed jdk which does NOT have the JDBC Oracle driver.


PHP

PHP on the Linux student webserver can access Oracle data via the OCI8 PHP-Oracle connector. (http://linux.students.engr.scu.edu)
NOTE: There is currently no support for PHP access to Oracle on the Solaris web server. (http://students.engr.scu.edu or http://sol.students.engr.scu.edu)

Information necessary to connect to the DB from PHP:
(remember the user/pass are your Oracle user/pass, which may differ from your Unix or Windows user/pass)

<html>
<?php
$conn = oci_connect('username', 'password', '//bajor.engr.scu.edu/db9i.engr.scu.edu');
if($conn) {
	print "<br> connection successful";
} else {
	$e = oci_error;
	print "<br> connection failed:";
	print htmlentities($e['message']);
	exit;
}
?></html>

For further information on actually using Oracle data from PHP, refer to the OCI8 documentation.

NOTE: For PHP to process your code, you need to give your file a ".php" extension.


Notes

Currently Oracle accounts are available only to students taking a database class or using a database for Senior Design work. Accounts will be removed by the start of the subsequent quarter. Students are encouraged to retain backups of their work as we will not be able to recover this data once accounts are removed.


Other Information Resources


Other Topics of Interest