13 April, 2007

Oracle client on Mac OS X

Here is a short step-by-stem guide how to install Oracle client (SQLPlus) onto you Mac machine.

1. Download instantclient-basic-macosx and instantclient-sqlplus-macosx from http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/macsoft.html

2. Unzipped them in /usr/oraclient

3. Set the DYLD_LIBRARY_PATH to /usr/oraclient

4. Add tnsnames.ora file into /usr/oraclient

5. Set TNS_ADMIN=/usr/oraclient

..and its done.

For more confortable useage you can place those environment variable envaluation into your .profile
and also inglude /usr/oraclient into PATH env.var.

04 April, 2007

Installing SUSE 10.2 (x86-64) & Oracle XE server

Some days ago me and Alan spent many hours installing SUSE 10.2 (x86-64) and Oracle XE server. Installing SUSE was no big deal until we started with Oracle XE server. I would like to point out 2 major mistakes we made.

Oracle installation requires libaio library. We assumed that x86-64 version of this library will do the trick, but we where very wrong. Installation was completed with no errors, but when we started to connect to database SQLPLUS kept throwing errors about wrong TNS and stuff. The real solution was in re-installing Oracle XE with 32bit libaio library.

Second rock on out smooth ride was that when installing Suse we didn't think that swap size really matters. We thought that 600MB would be enough but no. Oracle XE demanded that swap size must be at least 804MB. And we started all over again. A whole lot of fun.

P.S when you are in a hurry and you have a rather slow Internet connection, leave SUSE online update on the time when you have nothing else left to do.


Using tnsnames.ora with Oracle XE client

When installing Oralce XE client for Windows tnsnames.ora is not created by default, though it is pretty convenient way of connecting to database.

First, you have to add the variable TNS_ADMIN to your Oracle configuration in the registry.

Start regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_XEClient.

Then add a new string named TNS_ADMIN. Set the value to the directory where you want to store the tnsnames.ora file.

tnsnames.ora file looks something like this:


XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)