CISE Help & Resources
Oracle
Contents
- Oracle Documentation
- Registering for an Oracle Account (and Forgotten Passwords)
- Determining the Name of the Database Instance
- Using SQL*Plus on the Unix Command Line
- Using Oracle from CGI Scripts
- Using Oracle From Windows, or From Outside CISE
- Using JDBC with Oracle
- PHP and Oracle DB Connections
- Using Perl/DBI with Oracle
- Using Ruby/DBI with Oracle
- Using Embedded SQL and the Oracle Pro*C/C++ Compiler
- Using Oracle on the SunOS machines
Oracle Documentation
Note: to prevent copyright infringements, this documentation is only availble within the CISE network.
To read this outside of the CISE network, ssh into sand or rain and run
lynx http://www.cise.ufl.edu/help/database/oracle.shtml or w3m -F http://www.cise.ufl.edu/help/database/oracle.shtml
Registering for an Oracle Account (and Forgotten Passwords)
To sign up for a CISE Oracle account, or to set a new password for an existing Oracle account if you have forgotten your password, go to the Oracle Account Registration Page.
You will need to supply the following information on the registration page:
- CISE Username
- Enter your CISE username
- CISE Password
- Enter your CISE password
- Oracle Password
- Select a password for you oracle account and enter it here. The password
must meet the following criteria:
- The password must be at least 8 characters.
- The password must have at least 4 unique charaters.
- The password must not contain your username.
- The password can contain numbers, the symbols !,#,$,%,&,*,+,-,=,^, upper and lower case letters.
- You should avoid starting with a single word and then doing common 1-character replacements such as replacing 'i' with 1 or 'a' with '\@'. Some of these will fail the good password check.
- Verify Oracle Password
- Enter your oracle password again. It must match the first time.
Determining the Name of the Database Instance
Currently, there is only 1 Oracle database instance running in the CISE department, the 'orcl' instance.
- orcl
- This is the Oracle 11g database instance used for most class and research
projects beginning Spring 2003.
Using SQL*Plus on the Unix Command Line
In order to use the command line SQL*Plus utility, do the following:
% source /usr/local/etc/ora11.csh % sqlplus <username>@<instance>
Where <username> is replaced with your CISE username, and <instance> is the name of the database instance you are using. You will be prompted for your password once you run the sqlplus command.
For all Oracle 11g accounts, use:
source /usr/local/etc/ora11.csh sqlplus (username here)@orcl
Note that by sourcing that file, you are setting the $ORACLE_HOME environment variable in the shell, which gets used by all programs subsequently run in that shell.
Our publicly-accessable Sun servers (sand, rain, and the sun lab machines) are running a version of SunOS not supported by Oracle 11. We suggest using one of the linux machines to use the 11g client. However, you can still connect to the Oracle 11 server using the old version 9 client. Instructons are available in our legacy instructions.
Using Oracle from CGI Scripts
If you are running a program as a CGI script, you will not have a shell from which you can source the /usr/local/etc/ora.csh file. In this case, you will need to set the environment variable $ORACLE_HOME from within your program to the value
/usr/local/libexec/oracle11g-client
E.g., in perl, you would do the following:
$ENV{ORACLE_HOME} = '/usr/local/libexec/oracle11g-client';
Please see the appropriate documentation for any other language on how to set environment variables there.
Using Oracle From Windows, or From Outside CISE
If you're using an Oracle client and need to specify the paramters, use the following for Oracle 11g accounts:
Server : oracle.cise.ufl.edu SID : orcl Port : 1521
Using JDBC with Oracle
To use Oracle's JDBC on CISE Solaris machines, add the following to your CLASSPATH:
/usr/local/libexec/oracle11g-client/jdbc/lib/:.
You should then be able to use the Oracle java classes (oracle.sql.*, oracle.jdbc.*, etc) in your java programs.
A quick Java example using JDBC is available here. Additional examples and demos can be found in the JDBC demo directory at:
/usr/local/libexec/oracle11g-client/jdbc
PHP and Oracle DB Connections
php (/usr/local/bin/php) now supports Oracle. Please see the manual here. Oracle support is discussed here.
A quick PHP exmple using OCI8 is available here.
More info on PHP at CISE can be found at the CISE PHP page
Using Perl/DBI with Oracle
To use Oracle in Perl, use the DBD::Oracle module. Relevant documentation are in the man pages for DBI and DBD::Oracle.
A short Perl example using DBI is here.
Using Ruby/DBI with Oracle
For anyone interested in using the Ruby language, there's also support for Oracle in Ruby on CISE systems, using a DBI module modelled after the perl DBI scheme:
DBI.connect("dbi:Oracle:classdb", "username", "password" ) { |dbh|
dbh.prepare("select * from mytable") { |sth|
sth.execute(tablespace)
sth.each { |row|
p row
}
}
}
Using Embedded SQL and the Oracle Pro*C/C++ Compiler
For those using embedded SQL, the documentation can be found in the Oracle documentation
Using Oracle on the SunOS machines
Our publicly-accessable Sun servers (sand, rain, and the sun lab machines) are running a version of SunOS not supported by Oracle 11. We suggest using one of the linu x machines to use the 11g client. However, you can still connect to the Oracle 11 server using the old version 9 client. Instructons are available in our legacy instructions.