Oracle Database : NLS_LANG and National Character Set

NLS_LANG environment variable indicate the Oracle language and the character set.
The normal values are NLS_LANG=language_territory.characterset

To check the value of NLS_LANG for an existing database:
1. If the environment vairable is set do echo $NLS_LANG
2. Query v$nls_parameters

select decode(parameter, 'NLS_CHARACTERSET', 'CHARACTER SET',
'NLS_LANGUAGE', 'LANGUAGE',
'NLS_TERRITORY', 'TERRITORY') NAME,
value from v$nls_parameters
WHERE parameter IN ( 'NLS_TERRITORY','NLS_LANGUAGE','NLS_CHARACTERSET');


Example output is:

NAME          VALUE
------------- ----------------------------------------------------------------
LANGUAGE      AMERICAN
TERRITORY     AMERICA
CHARACTER SET WE8ISO8859P15

To find out the National Character Set:

select value
from NLS_DATABASE_PARAMETERS
where parameter = 'NLS_NCHAR_CHARACTERSET';


Example output:
VALUE
----------------------------------------
UTF8

Reference:
The National Character Set ( NLS_NCHAR_CHARACTERSET ) in Oracle 9i, 10g and 11g [ID 276914.1]

No comments:

Post a Comment