Sunday 27 January 2013

How to check NLS_LENGTH_SEMANTICS


> NLS_LENGTH_SEMANTICS allows one to specify the length of a column datatype in terms of CHARacters rather than in terms of BYTEs.

> The NLS_LENGTH_SEMANTICS value found in NLS_DATABASE_PARAMETERS is the value at database creation time. This should be BYTE.

SQL> SELECT value FROM NLS_DATABASE_PARAMETERS where parameter='NLS_LENGTH_SEMANTICS';

VALUE
--------------------------------------------------------------------------------------
BYTE

SQL> SELECT value FroM V$PARAMETER WHERE NAME LIKE '%nls_length_semantics%';

VALUE
--------------------------------------------------------------------------------------
BYTE

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi Pavan,

    The database parameter shows "CHAR".
    Please find the below,
    SQL> SELECT value FROM NLS_DATABASE_PARAMETERS where parameter='NLS_LENGTH_SEMANTICS';

    VALUE
    --------------------------------------------------------------------------------
    CHAR

    could you please help me in altering the value to BYTE.
    I tried to alter by using the below alter command,
    alter system set NLS_LENGTH_SEMANTICS=BYTE scope=both;

    Also, I restarted the database to get the changes reflected.
    However, the parameter value still seem to be CHAR.

    Please help me out.
    Thanks in advance.

    ReplyDelete
  3. Hi
    NLS_DATABASE_PARAMETERS is the value of NLS_LENGTH_SEMANTICS at time when db was CREATED. when it was altered later you have to check in db parameters and NOT in NLS_DATABASE_PARAMETERS

    ReplyDelete