Posted
Filed under ORACLE

9i에서 10G이상 데이터를 이관하다 보면 ,
charset을 euc-kr에서 utf-8로 변경해야 되는 상황이 발생 한다.
그랬을 때 byte로 되어 있는 euc-kr을 utf-8로 이관 하면서
varchar2에 maxsizse를 넘어 버려서 에러가 발생하는 경우가 있다
그러면 다음과 같이 nls_length_semantics을 default BYTE를
CHAR로 변환 한다.


#in sqlplus
show parameter nls_length
alter system set nls_length_semantics=CHAR scope=both;
show parameter nls_length



NLS_LENGTH_SEMANTICS
enables you to create CHAR and VARCHAR2 columns using either byte or character length semantics. Existing columns are not affected.

NCHAR, NVARCHAR2, CLOB, and NCLOB columns are always character-based. You may be required to use byte semantics in order to maintain compatibility with existing applications.

NLS_LENGTH_SEMANTICS does not apply to tables in SYS and SYSTEM. The data dictionary always uses byte semantics.

Property Description
Parameter type String
Syntax NLS_LENGTH_SEMANTICS = string

Example: NLS_LENGTH_SEMANTICS = 'CHAR'

Default value BYTE
Modifiable ALTER SESSION
Range of values BYTE | CHAR
2014/02/20 11:20 2014/02/20 11:20