Author Archives: SandeepSingh DBA

About SandeepSingh DBA

Hi, I am working in IT industry with having more than 10 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

NLS_NCHAR_CHARACTERSET and NLS_CHARACTERSET define in Oracle

Use of NLS_NCHAR_CHARACTERSET and NLS_CHARACTERSET in Oracle

National Character Set(NLS_NCHAR_CHARACTERSET) defines the encoding of NCHAR, NVARCHAR2, and NCLOB columns and is in 9i and up consistently Unicode. eg. AL16UTF16

Character Set(NLS_CHARACTERSET) defines the encoding of CHAR, VARCHAR2, LONG, and CLOB columns, these can also be used for storing Unicode. eg AL32UTF8 or UTF8

The national Character set (NLS_NCHAR_CHARACTERSET) is used for data stored in NCHAR, NVARCHAR2, and NCLOB datatypes and is a character set that is defined in addition to the (standard) database character set (NLS_CHARACTERSET), which is used for CHAR, VARCHAR2, LONG and CLOB datatypes.

Check the value of the Character Set

SQL> select value from NLS_DATABASE_PARAMETERS where parameter='NLS_CHARACTERSET';

VALUE
----------------------------------------
AL32UTF8

SQL> select value from NLS_DATABASE_PARAMETERS where parameter='NLS_NCHAR_CHARACTERSET';

VALUE
------------------------------------------
AL16UTF16

Note:
1. It is the general perception of the people that the NLS_NCHAR_CHARACTERSET is used for the UNICODE support in Oracle. It’s not true.
2. The NLS_NCHAR_CHARACTERSET (NCHAR, NVARCHAR2, NCLOB) is in 9i and up always Unicode.
3. You can use “normal” CHAR, VARCHAR2, and CLOB columns for storing Unicode in an AL32UTF8 / UTF8 NLS_CHARACTERSET database.