NLS_LANGUAGE
: Determines the language for error messages, day and month names, and default sorting rules.NLS_TERRITORY
: Specifies default date format, decimal character, group separator, and currency symbol based on geographic location.NLS_CURRENCY
: Defines the local currency symbol used in number formatting.NLS_DUAL_CURRENCY
: Specifies the dual currency symbol for euro currency support.NLS_ISO_CURRENCY
: Sets the ISO currency code used in number formatting.NLS_NUMERIC_CHARACTERS
: Defines decimal and group separator characters for numeric display.NLS_LENGTH_SEMANTICS
{ 'BYTE
' | 'CHAR
' }:
Controls whether the length of CHAR
, VARCHAR2
, and LONG
columns is defined in bytes or characters.
This is particularly important for multibyte character sets where a single character may occupy multiple bytes.NLS_CHARACTERSET
:
Specifies the character encoding used for data stored in CHAR
, VARCHAR2
, CLOB
, and LONG
columns.
This is set at database creation and cannot be changed afterward.NLS_NCHAR_CHARACTERSET
:
Defines the character encoding for national character datatypes NCHAR
, NVARCHAR2
, and NCLOB
.
Commonly set to AL16UTF16 or UTF8.NLS_NCHAR_CONV_EXCP
: { FALSE
| TRUE
}:
Determines whether data conversion between CHAR and NCHAR datatypes raises an exception when data loss might occur.NLS_CALENDAR
:
Specifies the calendar system used for date calculations and formatting:
{'Arabic Hijrah
' |
'English Hijrah
' |
'Gregorian
' |
'Japanese Imperial
' |
'Persian
' |
'ROC Official (Republic of China)
' |
'Thai Buddha
' }NLS_DATE_LANGUAGE
: Controls the language used for day and month names in date formatting.NLS_DATE_FORMAT
: Sets the default format mask for DATE datatype display and input.NLS_TIMESTAMP_FORMAT
: Defines the default format for TIMESTAMP datatypes.NLS_TIMESTAMP_TZ_FORMAT
: Specifies the format for TIMESTAMP WITH TIME ZONE datatypes.NLS_SORT
: { BINARY
| linguistic_definition
}:
Determines the collation sequence for character data sorting.
BINARY provides fastest performance, while linguistic definitions support language-specific sorting rules.NLS_COMP
: { BINARY
| LINGUISTIC
| ANSI
}:
Controls comparison semantics for character data in WHERE clauses and comparison operations.V$NLS_VALID_VALUES
dynamic performance view provides a comprehensive list of valid values for specific NLS parameters.
This view is essential to verify supported configurations before implementing NLS changes.SELECT DISTINCT parameter FROM v$nls_valid_values;Query result:
| PARAMETER | +--------------+ | CHARACTERSET | | LANGUAGE | | SORT | | TERRITORY |Each parameter in this view represents an NLS setting with a finite set of supported values. The
CHARACTERSET
parameter shows available character encodings, LANGUAGE
lists supported languages, SORT
displays available linguistic sorting definitions, and TERRITORY
contains valid territory specifications.SELECT * FROM v$nls_valid_values WHERE parameter = 'CHARACTERSET';Query result:
| PARAMETER | VALUE | ---------------+-----------| | CHARACTERSET | US7ASCII | | CHARACTERSET | UTF8 | | CHARACTERSET | AL16UTF16 | ...This information is particularly important when troubleshooting character set related issues.
NLS_DATABASE_PARAMETERS
view displays the NLS parameter values that were established when the database was created.
These settings serve as the foundation for all NLS behavior and can only be changed through database recreation or specific administrative procedures for certain parameters.SELECT parameter, value FROM nls_database_parameters;Query result:
| PARAMETER | VALUE | --------------------------+----------------------------------+ | NLS_LANGUAGE | AMERICAN | | NLS_TERRITORY | AMERICA | | | | NLS_CURRENCY | $ | | NLS_DUAL_CURRENCY | $ | | NLS_ISO_CURRENCY | AMERICA | | | | NLS_NUMERIC_CHARACTERS | '.,' | | | | NLS_LENGTH_SEMANTICS | BYTE | | NLS_CHARACTERSET | | | NLS_NCHAR_CHARACTERSET | | | | | NLS_NCHAR_CONV_EXCP | FALSE | | | | NLS_CALENDAR | Gregorian | | NLS_DATE_LANGUAGE | AMERICAN | | NLS_DATE_FORMAT | 'YYYY-MM-DD' | | NLS_TIMESTAMP_FORMAT | 'YYYY-MM-DD HH:MI:SS.FF' | | NLS_TIMESTAMP_TZ_FORMAT | 'YYYY-MM-DD HH:MI:SS.FF TZH:TZM' | | | | NLS_SORT | BINARY | | NLS_COMP | LINGUISTIC |Note that character set parameters (
NLS_CHARACTERSET
and NLS_NCHAR_CHARACTERSET
) are fundamental database properties that cannot be easily changed after database creation.NLS_INSTANCE_PARAMETERS
view shows NLS parameter values that are set at the database instance level.
These parameters can be configured in the initialization parameter file (SPFILE or PFILE) and take effect when the instance starts.
Instance-level settings override database-level defaults but can be superseded by session-level modifications.SELECT parameter, value FROM nls_instance_parameters;Query result:
| PARAMETER | VALUE | --------------------------+----------------------------------+ | NLS_LANGUAGE | AMERICAN | | NLS_TERRITORY | AMERICA | | | | NLS_CURRENCY | $ | | NLS_DUAL_CURRENCY | $ | | NLS_ISO_CURRENCY | AMERICA | | | | NLS_NUMERIC_CHARACTERS | '.,' | | | | NLS_LENGTH_SEMANTICS | BYTE | | | | NLS_NCHAR_CONV_EXCP | FALSE | | | | NLS_CALENDAR | Gregorian | | NLS_DATE_LANGUAGE | AMERICAN | | NLS_DATE_FORMAT | 'YYYY-MM-DD' | | NLS_TIMESTAMP_FORMAT | 'YYYY-MM-DD HH:MI:SS.FF' | | NLS_TIMESTAMP_TZ_FORMAT | 'YYYY-MM-DD HH:MI:SS.FF TZH:TZM' | | | | NLS_SORT | BINARY | | NLS_COMP | LINGUISTIC |Instance-level NLS parameters are particularly useful in environments where multiple applications with different localization requirements connect to the same database, as they provide a consistent baseline while allowing application-specific customization at the session level.
NLS_SESSION_PARAMETERS
view displays the current NLS parameter values for your active database session.
These are the actual values that Oracle uses for formatting, sorting, and processing data within your session.
Session-level parameters take the highest precedence in Oracle's NLS hierarchy and can be dynamically modified without affecting other database sessions.ALTER SESSION
statement.
This flexibility allows applications to customize their locale behavior without impacting other users or requiring database-wide changes.SELECT parameter, value FROM nls_session_parameters;Query result:
| PARAMETER | VALUE | --------------------------+----------------------------------+ | NLS_LANGUAGE | AMERICAN | | NLS_TERRITORY | AMERICA | | | | NLS_CURRENCY | $ | | NLS_DUAL_CURRENCY | $ | | NLS_ISO_CURRENCY | AMERICA | | | | NLS_NUMERIC_CHARACTERS | '.,' | | | | NLS_LENGTH_SEMANTICS | BYTE | | | | NLS_NCHAR_CONV_EXCP | FALSE | | | | NLS_CALENDAR | Gregorian | | NLS_DATE_LANGUAGE | AMERICAN | | NLS_DATE_FORMAT | 'YYYY-MM-DD' | | NLS_TIMESTAMP_FORMAT | 'YYYY-MM-DD HH:MI:SS.FF' | | NLS_TIMESTAMP_TZ_FORMAT | 'YYYY-MM-DD HH:MI:SS.FF TZH:TZM' | | | | NLS_SORT | BINARY | | NLS_COMP | LINGUISTIC |Session-level NLS parameters can be modified using the
ALTER SESSION
command, which immediately changes the behavior for the current session without requiring reconnection.
These changes remain in effect until the session ends or the parameter is explicitly changed again.ALTER SESSION SET NLS_SORT = BINARY;