views:

53

answers:

1

We have a requirement to store char data of different language in the same db schema. Oracle 10g is our DB. I am hoping that someone who have already done this would give me more specific instructions on how to i18n enable a oracle 10g db. We just need to store the data from multiple locales as well as collation (hoping all major db's support this) support at the db level. We doesn't need formatting of dates, datetime, numbers, currency etc.

I read some documentation on oracle's i18n support but somewhat confused about their many nls_* properties. Should I be using nls_lang or nls_language or NLS_CHARACTERSET.....

+4  A: 

Assuming that you are building the database from scratch, not trying to retrofit an existing database which introduces other problems.

In the database, you need to ensure that the database character set supports all the characters you want to store. Presumably, that means setting the NLS_CHARACTERSET of the database to AL32UTF8. Personally, I prefer to set NLS_LENGTH_SEMANTICS to CHAR as well. That changes the default behavior of a VARCHAR2(n) to allocate n characters of storage rather than n bytes. Since AL32UTF8 is a variable-length character set, using byte semantics is generally problematic because you either have to declare fields that are 3 times as long and end up with different users being able to enter a different number of characters in the same field.

NLS_LANG is a client setting. That identifies the character set that the client is going to request the data be converted into. That generally depends on the code page of the operating system.

Justin Cave
thx for clear answer. what is the meaning if AL32UF8. is this different than UTF8?
Pangea
AL32UTF8 is UTF8 ver. 3.1
walla
thank you. Little bit more details can be found at http://oracleappstechnology.blogspot.com/2007/10/difference-between-utf8-and-al32utf8.html
Pangea
i tried with the setting "NLS_LANG=AMERICAN_AMERICA.AL32UTF8" and i got an error back "ORA-12705: invalid or unknown NLS parameter value specified"
Pangea
i was able to fix this issue. here is the correct setting for others benefit: NLS_LANG=American_America.AL32UTF8.
Pangea
Be careful on NLS_LENGTH_SEMANTICS=CHAR. Some programs do not work nicely with it. An example is the server side install of Crystal Reports. It throws errors when logging in after creating objects with this.
REW