My Oracle Notes

Here are some quick memos about Oracle. They are mostly here to be a place where I can refresh my memory.

== Start a Oracle databse instance ==

* Setup paths and SID
export ORACLE_HOME=/usr/oracle/Ora901
export ORACLE_SID=mysid

* Start TNS Listner
lsnrctl start

* Startup the instance

$ sqlplus "/ as sysdba"

SQL*Plus: Release - Production on Mon Dec 3 11:51:25 2007

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to an idle instance.

SQL> startup


Here is a small Java application which connects to a database using JDBC and prints some information.

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

public class JDBCInfo {
private Connection conn;

public JDBCInfo(String driver, String url) {
if (driver != null) {
try {
System.out.println("Registered JDBC driver '" + driver + "'");
} catch (ClassNotFoundException e) {