This content has been marked as final. Show 10 replies
I've noticed that the instant client works with 10gR1 and not so well with 10gR2.
Are you using 10.0.2 ? Or 10.2 of Oracle?
Some links that might help:
The last thing to check is your tnsnames.ora, sqlnet.ora, and listener.ora
Since 9i connection is made through a service name and not the sid:
A specially formatted description of the destination for a network connection. A connect descriptor contains destination service and network route information.
The destination service is indicated by using its service name for Oracle9i or Oracle8i databases or its Oracle System Identifier (SID) for Oracle release 8.0 databases. The network route provides, at a minimum, the location of the listener through use of a network address.
Here are the basics on using the tools to set that up
Some good info on the listener:
Some nifty advanced tuning stuff:
As far as the NLS lang variable goes - typically if you are speaking english or some other european latin based derivative, the latin charcter set will work well with what you have installed as the NLS Lang Variable in Oracle... thats the short answer. Here is the long answer:
4 important remarks:
* Setting the NLS_LANG to the characterset of the database MAY be correct
but IS NOT ALWAYS correct. Please DO NOT assume that NLS_LANG needs to be ALWAYS the same as the database characterset. THIS IS NOT TRUE.
* The characterset defined with the NLS_LANG parameter does NOT CHANGE
your client's characterset, it is used to let Oracle know what characterset
you are USING on the client side, so Oracle can do the proper conversion.
I just realized after the last post, that not everyone is amiliar with the latin character set.
I'm refering to ISO 8859-1 Or WE8ISO8859P1
The default on my pc is
[AMERICAN_AMERICA.WE8MSWIN1252] which may or may not be what I need.
But some how for me the following always does the trick nicely.
The reall killer in going from UTF to another format or vice versa. The 10g OCI client puts to much faith in Microsoft and defaults you to whatever is in windows.
-- Checking your NLS:
From windows, to check the NLS_LANG, you need to open a command prompt and to run sqlplus in command line mode.
First, check if it's set in the environment:
SQL> host echo %NLS_LANG%
If this reports just %NLS_LANG% back, the variable is not set in the
environment. If it's set it reports something like
If NLS_LANG is not set in the enviroment, you should check the value
in the registry:
If you get something like:
unable to open file ".[ENGLISH_UNITED KINGDOM.WE8ISO8859P1]."
the "file name" between the '' is the value of the registry parameter.
(This is NOT an error but just a "trick" to get the NLS_LANG value)
If you get this as result:
unable to open file ".[%NLS_LANG%]."
then the parameter NLS_LANG is also not set in the registry.
Note: the @.[%NLS_LANG%]. "trick" reports the NLS_LANG known by the sqlplus
executable, it will not read the registry itself.
But then you are not sure if the variable is set in the enviroment or in the
registry. That's the reason of checking with the host commando first.
One last gem that might help just incase you get a link error:
java -classpath %cp% -Djava.library.path=C:\instantclient10_1 MyJavaApp
And a sample tnsnames.ora file entry for you:
MYDB = (DESCRIPTION=
( ADDRESS= (PROTOCOL=tcp)(HOST=MYHOST)(PORT=1521) )
( CONNECT_DATA=(SERVICE_NAME=ORCL) )
Sample connection jdbc url
It all works nicely for me. Going live with my first Oracle 10g RAC in production on Sunday. Wish me luck! OCI works fantastically well with the intant client, tomcat and a 10G RAC. TAF and load balancing work nicely with OCI.
Interesting note on the ojdbc14_g.jar. I've verified you can get the same error if you have the wrong JDBC driver for your application. Find the ojdbc*.jar file in your application and replace it with the latest driver from here:
Edited by: Britton LaRoche on Jun 9, 2009 6:34 PM