Friday, July 31, 2009

Oracle InstantClient on Mac OS X

50C56D92-05FA-457B-8CAB-7283FC0E70FA.jpg

In the past I thought I had this working, only to find out in the end that I didn't. I really prefer to work natively on my Mac (which Mac user doesn't) rather then having to use a Windows command prompt for my SQL*Plus action. Today I was able to get it working, which wasn't as hard as I thought it was in the past. Here is what to do:

  • Download the Oracle Instant Client Package - Basic for your correct architecture (Intel / PPC)
  • Download the Oracle Instant Client Package - SQL*Plus for your correct architecture (Intel / PPC)
  • Unzip the file instantclient-basic-10.2.0.4.0-macosx-x86.zip
  • Rename the folder "InstantClient"
  • Unzip the file instantclient-sqlplus-10.2.0.4.0-macosx-x86.zip
  • Move all of these files into the previously renamed folder "InstantClient"
  • Move the "InstantClient" folder to the "/Applications" folder of your Mac
  • Open the Mac OS X Terminal Application
  • Edit your bash profile script by entering "vi ~/.bash_profile", without the quotes
  • Press the "i" key on your keyboard to enter the "INSERT" mode of this editor
  • Create an Oracle_Home variable by typing export ORACLE_HOME="/Applications/instantclient"
  • Create an DYLD_LIBRARY_PATH variable by typing export DYLD_LIBRARY_PATH=$ORACLE_HOME"
  • Create an TNS_ADMIN variable by typing export export TNS_ADMIN=$ORACLE_HOME"
  • Update the PATH variable by modifying the PATH=$PATH:$ORACLE_HOME line
  • Press the Escape (ESC) key once
  • Press the ":" key, no quotes, then press "wq", no quotes, and press enter.
  • The last item is to find a copy of your TNSNAMES.ora file that your Oracle administrator can provide you and drop it into the /Applications/InstantClient folder
  • Open a new Terminal shell and type "sqlplus < your Oracle username >@< your oracle TNS name > and press Enter
  • No comments: