This describes how I set up Oracle 10g on OSX Tiger for development use.
Sergio has an excellent instruction on how to install Oracle 10g on Panther. However because the Oracle requires gcc 3.3 and Tiger uses gcc 4 by default. Some hacks are in order.
Following Sergio's instruction to prepare Oracle installation environment. Issue the following commands before launch installer.
sudo nicl . -append /groups/admin users oracle sudo gcc_select 3.3Then launch the Oracle installer. The installation will fail towards the end when running database creation wizard. Simply abort and do following extra steps.
Step 1: Firstly, set up $ORACLE_HOME and $PATH in your .bash_profile. By default, the ORACLE_HOME is at "/Volumes/u01/app/oracle/product/10.1.0/db_1" if you follow Sergio's instruction. While logged in as oracle, add following two lines to .bash_profile, adjust the ORACLE_HOME value as necessary.
export ORACLE_HOME="/Volumes/u01/app/oracle/product/10.1.0/db_1" export PATH=$PATH:~/bin:$ORACLE_HOME/binIssue following command to activate new settings.
cd . .bash_profile
Step 2: Relink Oracle libraries.
cd $ORACLE_HOME/lib mv libnnz10.dylib libnnz10.dylib.ori relink all mv libnnz10.dylib.ori libnnz10.dylib
Step 3: Run 'dbca' to create a database.
Step 4: Run '$ORACLE_HOME/root.sh'. This script will appear hang at end and displaying a message "Expecting the CRS daemons to be up within 600 seconds." The CRS is only available on OSX Server so simply Ctrl-C terminate the process.
Step 5: Download Oracle startup and stop script and extract it to 'oracle' user home. Now you can start and stop Oracle instance by running 'startup.sh' and 'stop.sh' respectively.
Step 6: If your machine has a fixed IP, you probably don't need to perform this step. Since I run Oracle on my powerbook and I am only going to use this Oracle for development purpose, I change listener.ora and tnsnames.ora under $ORACLE_HOME/network/admin to make it work with dynamic ip like 192.168.0.1 and only connectable from localhost.
My listener.ora looks like:
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = test1) (ORACLE_HOME = /Volumes/u01/app/oracle/product/10.1.0/db_1) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) ) )
And my tnsnames.ora looks like:
TEST1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = test1) ) ) EXTPROC_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO) ) )
One final point, Oracle 10g has its own JDBC driver. Drivers for Oracle 9 won't work with 10g.