Search notes:

Oracle: NLS related init parameters

select * from nls_session_parameters order by parameter;

NLS_CALENDAR              GREGORIAN
NLS_COMP                  BINARY
NLS_CURRENCY              SFr.
NLS_DATE_FORMAT           yyyy-mm-dd hh24:mi:ss
NLS_DATE_LANGUAGE         ENGLISH
NLS_DUAL_CURRENCY         SF
NLS_ISO_CURRENCY          SWITZERLAND
NLS_LANGUAGE              ENGLISH
NLS_LENGTH_SEMANTICS      BYTE
NLS_NCHAR_CONV_EXCP       FALSE
NLS_NUMERIC_CHARACTERS    .'
NLS_SORT                  BINARY
NLS_TERRITORY             SWITZERLAND
NLS_TIMESTAMP_FORMAT      yyyy-mm-dd hh24:mi:ssXff
NLS_TIMESTAMP_TZ_FORMAT   yyyy-mm-dd hh24:mi:ssXff tzr
NLS_TIME_FORMAT           HH24:MI:SSXFF                      -- Used for internal purposes only
NLS_TIME_TZ_FORMAT        HH24:MI:SSXFF TZR                  -- Used for internal purposes only

NLS_CHARACTERSET

The value of nls_characterset defines the character set for the char, varchar2, clob and long data types.
utl_file assumes the files it reads or writes are to be in the character set specified with nls_characterset.
A list of valid values for nls_characterset can be obtained with
select
   value,
   isdeprecated
from
   v$nls_valid_values
where
   parameter = 'CHARACTERSET'
order by
   value;
Compare with nls_nchar_characterset

NLS_COMP

NLS_COMP can be set to one of
If NLS_COMP is not set in the init parameters, its value shows up as null in V$PARAMETER, V$SYSTEM_PARAMETER, V$PARAMETER2, V$SYSTEM_PARAMETER2 and NLS_INSTANCE_PARAMETERS, but behaves as though it was set to BINARY.

NLS_DATE_FORMAT

Gone here.

NLS_LANG

The purpose of NLS_LANG is to specify the character set of the client so that Oracle can correctly convert between the client's encoding (nls_lang) and the database's encoding (nls_characterset, nls_nchar_characterset).
The value of NLS_LANG sets the language and territory of both, the session running on the Server, and the client.
Do not confuse NLS_LANG with NLS_LANGUAGE (NLS_LANG, unlike NLS_LANGUAGE, is not an init parameter that can be set in init.ora or an spfile).
NLS_LANG has three components, all of which are optional.
language Controls the language of day and month names and error messages, and sorting.
territory Specifies the default format for dates, numbers and monetary values.
character set Specifies the character set with which a user works. Each language has a default character set assosiated with it (which seems to be used when character set is not explicitly specified)
These components are separated
An example of an NLS_LANG value is FRENCH_CANADA.WE8ISO8859P1.
The language specifies the value of NLS_LANGUAGE, the value of territory the value of NLS_TERRITORY.
The value of NLS_LANG should correspond to that of the client's operating system.

Determining the value of NLS_LANG

select
   any_value(client_charset) nls_lang
from
   v$session_connect_info
where
   sid = sys_context('userenv', 'sid');
In SQL*Plus, when running in Windows, the value of NLS_LANG can be determined with the following esoteric command (see here):
SQL @[%NLS_LANG%]

TODO

See also

SQLcl apparently does not take the value of nls_lang into account. Instead, set encoding should be used.
MOS note 137127.1: Character Sets, Code Pages, Fonts and the NLS_LANG Value 

NLS_LANGUAGE

Do not confuse NLS_LANGUAGE with NLS_LANG: The language part of NLS_LANG sets the (default) value for NLS_LANGUAGE.

NLS_LENGTH_SEMANTICS

The value of NLS_LENGTH_SEMANTICS can be set to BYTE (default value) or CHAR.
For database objects creted in the current session, this value specifies, the default length semantics to use for
While the value of NLS_LENGTH_SEMANTICS affects the use of VARCHAR2 and CHAR, the NCHAR, NVARCHAR2, CLOB and NCLOB are always character-based.
See also VARCHAR2: BYTE vs CHAR.

NLS_NCHAR_CHARACTERSET

nls_nchar_characterset defines the character set in which nchar, nvarchar2 and nclob data is stored.
Only two values (both of which are Unicode character sets) are allowed for nls_nchar_characterset:
See also nls_characterset, MOS Note 276914.1

NLS_NUMERIC_CHARACTERS

The value of nls_numeric_characters consists of two characters:
See also the ORA-01481: invalid number format model error message.

NLS_SORT

The value of NLS_SORT specifies the collating sequence for character value comparison. Thus, this value influences the outcome of
The exact operators and query clauses that obey the NLS_SORT parameter depend on the value of the NLS_COMP parameter. If an operator or clause does not obey the NLS_SORT value, as determined by NLS_COMP, the collation used is BINARY.
Setting the value of nls_sort to binary causes the values to be sorted according to the byte value of the compared value.
If _CI is appended to the value of NLS_SORT, the values are compared case-insensitively (see for example selecting case insensitively in a where clause).
Appending _AI causes the values to be sorted accent-insensitively.
The value of NLS_SORT can also be set using the environment variable NLS_SORT.
The current value of NLS_SORT is returned by sys_context('userenv', 'nls_sort').
The value of NLS_SORT influences the behavior of comparison operations (for example in the where clause) if NLS_COMP is set to linguistics;

NLS_TERRITORY

The value of nls_territory determines the value of the following init parameters if they're not explicitly altered:
The value also influences the day of week (to_char(…, 'D')).
The default value of NLS_TERRITORY is set by NLS_LANG

NLS_TIMESTAMP_FORMAT, NLS_TIME_TZ_FORMAT

alter session set nls_timestamp_format    = 'yyyy-mm-dd hh24:mi:ssxFF';
alter session set nls_timestamp_tz_format = 'yyyy-mm-dd hh24:mi:ssxFF TZR';
Compare with nls_date_format.

See also

How the value of NLS_SORT and NLS_COMP influences testing of string-equality.
sys_context('userenv', 'nls…')
nls.sql shows session, database and instance NLS-values.
init parameters
The functions get_nls_parameter and set_nls_parameter in dbms_debug_jdwp.
v$nls_valid_values, v$nls_parameters.
Temporarily change an NLS setting in a session
NLS related data dictionary views
Specifying nls parameter values when using to_char
Globalization (NLS) related SQL functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1741088440, '18.119.140.226', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/adminstration/init-parameters/nls/index(284): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78