Oracle8i National Language Support Guide Release 2 (8.1.6) Part Number A76966-01 |
|
This chapter provides an overview of Oracle NLS support, including:
Oracle's National Language Support (NLS) architecture allows you to store, process, and retrieve data in native languages. It ensures that database utilities and error messages, sort order, date, time, monetary, numeric, and calendar conventions automatically adapt to the native language and locale.
Parameter settings determine the behavior of individual conventions.
Oracle's National Language Support architecture is implemented with the use of the Oracle NLS Runtime Library. The NLS Runtime library provides a comprehensive suite of language-independent functions, which allows for proper text and character processing and language convention manipulations. Behavior of these functions for a specific language and territory is governed by a set of locale-specific data identified and loaded at runtime.
Figure 1-1 illustrates loading locale-specific data at run time. For example, French and Japanese locale data is loaded.
The locale-specific NLS data is stored in a directory specified by the ORA_NLS* environment variable. For each new release, there is a different corresponding ORA_NLS data directory. For Oracle8i, the ORA_NLS33 directory is used. For example, on most UNIX platforms, the environment variable ORA_NLS33 should be set to $ORACLE_HOME/ocommon/nls/admin/data. On Win32 platforms, the default setting done by the installer should work fine as long as one ORACLE_HOME has just one release of Oracle.
Release |
Environment Variable |
7.2 |
ORA_NLS |
7.3 |
ORA_NLS32 |
8.0, 8.1 |
ORA_NLS33 |
If your system is running in a multi-version Oracle environment, you must ensure that the appropriate ORA_NLS* variable (for example, ORA_NLS33) is set and that the corresponding NLS data files for that release are available.
A boot file is used to determine the availability of the NLS objects that can be loaded. Oracle supports both system and user boot files. The user boot file gives you the flexibility to tailor what NLS locale objects will be available for the database, thus helping you control memory consumption. Also, new locale-data can be added and some locale-data components can be customized.
Oracle8i is implemented using a client/server architecture. The language-dependent operations are controlled by a number of parameters and environment variables on both the client and the server. On the server, each session started on behalf of a client may run in the same or different locale, and have the same or different language requirements specified.
A database itself also has a set of session-independent NLS parameters specified at its creation time. Two of them are the database and the national character set. They specify the character set used to store text data in the database. Other parameters, like language and territory, are used in the evaluation of CHECK constraints.
In the event that the client and server specify different character sets, Oracle8i will handle character set conversion of strings automatically.
As far as NLS architecture is concerned, all applications, even these running on the same physical machine as the Oracle instance, are considered clients. For example, SQL*Plus started by the Unix user which owns Oracle software, from the Oracle Home in which RDBMS software is installed, and connecting to the database through an adapter by specifying the ORACLE_SID, is still considered a client and its behavior is ruled by client-side NLS parameters.
When a client application is started, it initializes its client NLS environment from environment settings. All NLS operations performed locally are executed using these settings. Examples of local NLS operations are display formatting (using item format masks) in Oracle Developer applications or user OCI code executing NLS OCI functions with OCI environment handles. See Chapter 5, "OCI Programming", for further details.
When the application connects to a database, a session is created on the server. The new session initializes its NLS environment from NLS instance parameters specified in the initialization parameter file. These settings can be subsequently changed by an ALTER SESSION statement. The statement changes the session NLS environment only. It does not change the local client NLS environment. The session NLS settings are used in the processing of SQL and PL/SQL statements executed on the server.
Immediately after the connection, if the NLS_LANG environment setting is defined on the client side, an implicit ALTER SESSION statement synchronizes the client and the session NLS environments. See Chapter 2, "Setting Up an NLS Environment", for details.
Oracle's standard features include
Oracle8i allows users to store, process, and retrieve data in native languages. The languages that can be stored in an Oracle8i database are all languages written in scripts encoded by Oracle-supported character sets. Through the Unicode (UTF8) character set, Oracle8i supports most contemporary languages.
Additional support is available for a subset of the native languages, for which Oracle8i knows, for example, how to display dates using translated month names or how to sort text data according to cultural conventions.
When using the term language support, this manual refers to the additional language-dependent functionality, not to the ability to store text of the given language.
For some of the supported languages, Oracle provides translated error messages and a translated user interface of the database utilities.
Table 1-2 lists the languages supported, with an asterisk for languages with translated error messages.
See "Languages" for a complete list of Oracle language names and abbreviations.
Utilities and error messages can be made to appear in the native language. See "Translated Messages", for further details.
Oracle8i supports different cultural conventions which are specific to a given geographical location. Local time, date, numeric and monetary conventions are handled. The following territories are supported.
The world's various conventions for hour, day, month, and year can be handled in local formats.
Currency, credit, and debit symbols can be represented in local formats. Radix symbols and thousands separators can be defined by locales.
Gregorian, Japanese Imperial, ROC Official, Thai Buddha, Persian, English Hijrah, and Arabic Hijrah are supported. See "Calendar Systems" for a complete list of calendars.
Oracle8i provides linguistic definitions for culturally accurate sorting and case conversion.
Some of the definitions listed in Table 1-4 have two versions. The basic definition treats strings as sequences of independent characters. The extended definition recognizes pairs of characters that should be treated as special cases.
Strings converted to upper case or lower case using the basic definition always retain their lengths, strings converted using the extended definition may get longer or shorter.
Oracle supports a large number of single-byte, multi-byte, and fixed-width encoding schemes which are based on national, international, and vendor-specific standards. See "Character Sets" for a complete list of supported character sets.
Oracle allows you to customize character sets and calendars.
User-defined characters are sometimes needed to support special symbols, vendor-specific characters, or characters that represent proper names, historical terms, and so on. Developers can extend an existing character set definition by using the Unicode Private Use Area. See "Customized Character Sets" for further information.
You can define ruler eras for imperial calendars, and deviation days for lunar calendars. See "Customized Calendars" for further information.
NLS parameters can be used to modify the behavior of SQL functions. For instance, SQL functions that deal with time, date, monetary, and numeric formats, as well as sorting and character classification, can change behavior based on different NLS parameters that are implicitly set in the users' environment or explicitly set as a parameter to a function call. See Chapter 4, "SQL Programming", for further information about function calls and see Chapter 2, "Setting Up an NLS Environment", for information about environment parameters.
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|