Oracle DB export, possible charset conversion if NLS_LANG not set I need to export an Oracle database from one server and import it on another server. But I am getting the following information message at the beginning:


  Connected to: Oracle Database 10g Release 10.2.0.4.0 - 64bit
  Production Export done in US7ASCII character set and AL16UTF16 NCHAR
  character set server uses UTF8 character set (possible charset
  conversion)


Although the export still terminates successfully without warning, I was wondering whether the data in the database is still correct. Is there a need to set the NLS_LANG variable to match the character set of the server (in this case UTF-8)?

If I set the NLS_LANG variable to UTF-8 I don't get this information message. But the target server where I import the database again shows the following:


  import done in UTF8 character set and AL16UTF16 NCHAR character set
  import server uses AL32UTF8 character set (possible charset
  conversion)


If I understand that correctly these two servers use (slightly) different character sets - UTF-8 and AL32UTF8. 

I am confused on what I should set the NLS_LANG variable or even whether it is necessary to set. Should I use AL32UTF8 as NLS_LANG for the export and import?

EDIT: In case this information is important: I am using a SUSE Linux and for the export I use the command exp that comes with Oracle.
The NLS_LANG parameter is used by the Oracle network layer to do character translation between the client and the database. This way the client can display all the characters in the database in a 'correct' way.

Your NLS_LANG should match the character-set of your database when you do an export. If you export a UTF-8 database in US7ASCII then you risk to loose information when you import this data back into a database. Why? The UTF-8 character-set can hold much more different characters then US7ASCII. The 'unknown' characters are replaced by a single character. In the past I have seen this happening that we lost all characters with accents. They were replaced by a '?' if I remember well.

If you import then you must be sure that the NLS_LANG is set to the value of your import file. Oracle will then do the mapping to the character-set of the database in which you import.