System Administration > System maintenance > Maintaining the database server > Maintaining the Oracle database
NLS_LANG environment variable
The NLS_LANG environment variable is an Oracle variable used to define language, locale, and character set properties. When you perform Oracle export or import, you must set the NLS_LANG environment variable. The NLS_LANG environment variable controls character-set conversion between the source database and the target database. The NLS_LANG environment variable has the following format: NLS_LANG=language_territory.character-set For example: Copy NLS_LANG=AMERICAN_AMERICA.US7ASCII For export and import, only the character-set portion is important. For language_territory, you can always use AMERICAN_AMERICA. You must set the NLS_LANG environment variable explicitly. Note If you do not explicitly set NLS_LANG, the system uses the default value. On Linux systems, the default NLS_LANG value is AMERICAN_AMERICA.US7ASCII, which may cause export or import to issue warnings or errors. On Windows systems, the default NLS_LANG is obtained from the following Windows registry key: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEid id is 0, 1, 2, and so forth. The setting in the registry for the character set reflects the character set you selected when you created the database using Oracle DBCA. Set NLS_LANG for export When using Oracle export, set the character set on the NLS_LANG environment variable to the same character set as the database you are exporting. No conversion occurs, and the export file is created in the same character set as the original database. If you plan to import the file into a database with a different character set, you can postpone the conversion until the import. To determine the character set of the current database, type the following command in SQLPlus: Copy select value from nls_database_parameters where parameter='NLS_CHARACTERSET'; Set NLS_LANG for import When using Oracle import, setting the NLS_LANG environment variable depends on whether the source database and target database use the same character set: If the source database and target database use the same character set, set the NLS_LANG environment variable to use that character set. If the source database and target database use different character sets, leave the character set part of NLS_LANG the same on both export and import. Set it either to the same character set as the source database (preferred) or to the same character set as the target database. Conversion occurs only once, either on export or on import. To determine the character set of the current database, type the following command in SQLPlus: Copy select value from nls_database_parameters where parameter='NLS_CHARACTERSET';
Source: https://docs.sw.siemens.com/documentation/external/PL20251212545240207/en-US/tc_help/AWAdmin/fhs4814155880506/kkz1737238614272/opl1737238615588/yqk1737238615674/oranlslang.html · retrieved Fri Jul 31 2026 00:00:00 GMT+0000 (Coordinated Universal Time)