SlideShare a Scribd company logo
MythBusters Globalization Support
Avoid Data Corruption
Christian Gohmann
@CGohmannDE DOAG2018
About me…
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Christian Gohmann
Senior Consultant at Trivadis GmbH, Düsseldorf (Germany)
Instructor since 2014
– O-AI (Oracle Architecture and Internals)
– O-AI-DBA (Oracle Architecture and Internals for DBAs)
Tool Owner of TVD-Backup
Experiences with Oracle since 2006 (8i – 18c)
– Architecture, Installation & Configuration
– High Availability Solutions (RAC, Data Guard)
– Migration Projects
– Backup & Recovery (RMAN, Data Pump)
Blog: http://www.christian-gohmann.de
We help to generate added value from data
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
With over 650 specialists and IT experts in your region.
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
16 Trivadis branches and more than
650 employees
Experience from more than 1,900
projects per year at over 800
customers
250 Service Level Agreements
Over 4,000 training participants
Research and development budget:
CHF 5.0 million
Financially self-supporting and
sustainably profitable
Agenda
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
1. Fundamentals
2. Configuration
3. Conversion
4. Tools
5. Debugging
6. Migration
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Fundamentals
Globalization Support
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Store, process and retrieve data in native languages
– Allows the development of multilingual applications
Former known as National Language Support (NLS)
– Subset of the Globalization Support
Implemented with the Oracle NLS Runtime Library (NLSRTL)
– Functions for text and character processing and manipulations
Locale-specific data is stored in $ORACLE_HOME/nls/data
– Use ORA_NLS10 environment variable to choose a different location
– Loaded as independent set at runtime
Language Support
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Refers to the additional language-dependent functionalities
– Display dates using translated month names
– Sort text according to cultural conventions
– Translated error messages and user interfaces
Only available for a subset of the languages
Parameter: NLS_LANGUAGE
“Language Support means the ability to store text of a specific language”
SQL> ALTER SESSION SET nls_language = 'FRENCH';
BUSTED
Territory Support
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Has nothing to do with the ability to store characters in the database
Support of cultural conventions, specific to geographical locations
– Default local time format
– Date format
– Numeric and monetary conventions
Parameter: NLS_TERRITORY
“Territory support allows the database to store characters of different languages”
SQL> ALTER SESSION SET nls_territory = 'FRANCE';
BUSTED
Character Set Support 1/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
"A Character Set maps a number to a characters visual representation."
Two character sets are defined at database creation
National Character Set to store Unicode
– Limited to NCHAR, NVARCHAR2 and NCLOB data types
Oracle naming convention (except UTF8 and UTFE)
– <Region><Bit length><Standard Character Set Name>[S|C]
– Optional: S → Server, C → Client
– Example: WE8ISO8859P15
SQL> CREATE DATABASE TEST (
…
CHARACTER SET WE8MSWIN2152
NATIONAL CHARACTER SET AL16UTF16
);
Character Set Support 2/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Windows character sets like WE8MSWIN1252 can be used on Unix
– EBCDIC character sets cannot be used on ASCII platforms and vice-versa
"Windows character sets are limited to the Windows platform"
BUSTED
Calendar Systems
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Support of eight different calendar systems
Switch to a different calendar
NLS Calendar Utility can be used to register calendar modifications (*.nlt files)
Name Name
Gregorian Japanese Imperial
ROC Official (Republic of China) Thai Buddha
Persian English Hijrah
Arabic Hijrah Ethiopian
SQL> ALTER SESSION SET nls_calendar = 'Persian';
$> lxegen
Unicode Support
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Support of the Unicode standard since Oracle 7
Two ways to store Unicode characters in the database
– Create a database with a Unicode character set (e.g. UTF8)
– Support multilingual data in specific columns (NCHAR, NVARCHAR, NCLOB)
Oracle recommends the usage of AL32UTF8 (default since Oracle 12c Release 2)
Database Migration Assistant for Unicode (DMU)
Oracle Version Unicode Version
10g 4.0
11g 5.0
12c 6.2 / 7.0
18c 9.0
Enhancements in 12c and 18c
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Oracle 12c
Support for Unicode 6.2 / 7.0 (12c Release 2)
Support for 12 new languages and 32 new territories
Support for the Unicode Collation Algorithm (UCA)
Support for Pluggable Databases with different Character Sets
Column Level Collation (Case-insensitive Database)
Desupport of CSSCAN and CSALTER for migration to Unicode
– Instead use Database Migration Assistant for Unicode (DMU)
Oracle 18c
Support for Unicode 9.0
Support for 3 new languages and 31 new territories
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Configuration
General
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
A new session initializes the NLS environment from the NLS instance parameters
– If specific client-side NLS settings are given, an ALTER SESSION is executed
Check V$NLS_VALID_VALUES for valid values of NLS settings
Direct connection from the server acts like a client connection
Set NLS_% parameter on instance level requires restart of instance
SQL> ALTER SYSTEM SET nls_date_format = 'YYYY-MM-DD HH24:MI' SCOPE=SPFILE;
Client 1/3
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
NLS_LANG only represents the character set that the client use
– Example: German Windows client → GERMAN_GERMANY.WE8MSWIN1252
– Example: Unix client with Unicode locale → AMERICAN_AMERICA.UTF8
It can be the same, but it is not a must
It is required for proper conversion
If client and server character sets match, then no validation is enforced
“NLS_LANG must match the character set of the database server”
BUSTED
Client 2/3
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
If not set it defaults to the hardcoded value US7ASCII
Registry key: HKLMSOFTWAREORACLEKEY_<Oracle Home Name>
“If NLS_LANG is not set it uses the NLS_LANG of the database server”
SQL> ! echo $NLS_LANG
SQL> SELECT client_charset, network_service_banner
FROM v$session_connect_info
WHERE sid = SYS_CONTEXT('USERENV', 'SID');
CLIENT_CHARSET NETWORK_SERVICE_BANNER
-------------- ------------------------------------------------------------------------------
US7ASCII Oracle Bequeath NT Protocol Adapter for Linux: Version 12.1.0.1.0 - Production
US7ASCII Authentication service for Linux: Version 12.1.0.1.0 - Production
US7ASCII Encryption service for Linux: Version 12.1.0.1.0 - Production
US7ASCII Crypto-checksumming service for Linux: Version 12.1.0.1.0 - Production
BUSTED
Client 3/3
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Setting NLS_LANG changes nothing on the client
The character set can only be changed with operating system tools
“Setting NLS_LANG changes the character set of the client”
# Change Locale on Linux
$> export LANG=de_DE.CP1252
$> locale
LANG=de_DE.CP1252
LC_CTYPE="de_DE.CP1252"
…
LC_IDENTIFICATION="de_DE.CP1252"
BUSTED
Miscellaneous
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Different tools or input files require specific NLS_LANG settings
Tool NLS_LANG Comment
SQL Loader /
SQL Developer
Character set of the text/flat file
UTL_FILE Does not use it
Runs in the database. Assume encoding of the input
file is in the character set of the database. Otherwise
use UTL_RAW.CONVERT
Export Same as the database character set No character conversion
Import Character set of the source database Check with imp .. show=yes
Data Pump
Not affected by the NLS_LANG setting.
Only used for the parameter file.
SQLcl Does not evaluate NLS_LANG.
Because SQLcl is a Java program, it evaluates
environment variable LANG (except Windows)
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Conversion
Character Conversion
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Normally conversion is done at client side (OCI driver)
– 8.0.4 onwards
If character set is not known at client side, server side will do conversion
– 8.1.6 onwards
If server and client side character sets are the same, no validation will be
performed
– Increased performance
– Chance to write data garbage
Character Lifecycle
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Database
WEISO8859P15
Client / Tool
WE8MSWIN1252
Codepage 1252
Insert
"€"
Translate
"€" → 128 (20AC)
Convert codepage
128 → 164
Send codepage
164
User
Special Characters
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Some character sets offers mappings from unknown characters to known
characters
– E.g. é → e, ä → a
Character Description
□ The used font has no graphical representation for the codepage
¿ Replacement character that is used for unknown characters in the character set
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Tools
SQL*Plus 1/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
SQL*Plus in a DOS box does not use the regular Windows codepage
– Instead it uses the OEM environment (e.g. codepage 850)
– Character set part of NLS_LANG must be set to WE8PC850
– Alternatively change codepage using chcp and set different font
“The codepage of running SQL*Plus in a DOS box differs from the regular operating system
codepage"
$> chcp
Active Codepage: 850
$> chcp 1252
CONFIRMED
SQL*Plus 2/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Until Oracle 10g an ANSI version of SQL*Plus (sqlplusw.exe) exists
– Uses the configured Windows codepage (e.g. 1252)
– Officially replaced by the SQL Developer
On Windows only: SQL*Plus is not UTF8/Unicode aware
SQL Developer 1/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
SQL Developer needs no client side NLS configuration
– Unicode client
Download from Oracle Technology Network (OTN)
– http://www.oracle.com/technetwork/developer-tools/sql-developer
Change font if □ characters appear in the output
– Reason: The used font cannot display the character
– Tools > Preferences > Code-Editor > Fonts
SQL Developer 2/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Change specific NLS settings of the SQL Developer session
– Tools > Preferences > Database > NLS
– Changes will be applied immediately
Telnet/SSH Client
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Responsible for conversion of the Unix locale to the client's environment
– Translation settings must match the encoding of the Unix Shell
Example: Connection to an en_EN.ISO8859-15 Unix Shell with PuTTY
Locale Builder 1/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
View, modify or create Language, Territory, Character Set or Linguistic Sort
definitions
Available since Oracle 9i
– Windows: %ORACLE_HOME%nlslbuilderlbuilder.exe
– Unix: $ORACLE_HOME/nls/lbuilder/lbuilder
Open NLS locale data definitions using file or object name
Locale Builder 2/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Debugging
General 1/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Check data with a Unicode client like SQL Developer
Check NLS settings on different levels
Client character set is visible in the V$SESSION_CONNECT_INFO view
– Available since 11g Release 1
SQL> SELECT * FROM nls_database_parameters;
SQL> SELECT * FROM nls_instance_parameters;
SQL> SELECT * FROM nls_session_parameters; -- Current session
SQL> SELECT client_charset, network_service_banner
FROM v$session_connect_info
WHERE sid = SYS_CONTEXT('USERENV', 'SID');
General 2/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Get NLS_LANG value set in Registry only
SQL> host echo %NLS_LANG%
%NLS_LANG%
SQL> @.[%NLS_LANG%].
SP2-0310: Unable to open file ".[GERMAN_GERMANY.WE8MSWIN1252]..sql"
Character Set Health Check
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Use CSSCAN utility to search for incompatible characters (< 12c)
– Requires a schema called CSMIG to store internal data
Run CSSCAN as SYSDBA
– Set FROMCHAR and TOCHAR to the same value
Check cs_healthceck.txt for "Convertible" or "Lossy" entries
– If no entries exist, the current data is fine
SQL> @?/rdbms/admin/csminst.sql
$> csscan FULL=Y FROMCHAR=WE8ISO8859P1 TOCHAR=WE8ISO8859P1
ARRAY=1024000 LOG=cs_healthcheck CAPTURE=Y PROCESS=4
DUMP Function
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Returns datatype code, length (bytes) and internal representation
Supports CHAR, VARCHAR2, NCHAR, NVARCHAR2, DATE, NUMBER
– Cannot be used on CLOB or NCLOB columns
Useful to check if a specific character is supported
– Requires the usage of an Unicode client like SQL Developer
– If an insert in a table succeeded the Character Set supports the character
SQL> SELECT DUMP(col1, 10) FROM tab1;
SQL> SELECT DUMP('Text with € sign', 10, 1, 10) FROM dual;
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Migration
Superset vs. Subset
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Character set can be a Superset or a Subset of the new character set
Type Description
Superset All characters from character set A are included in character set B.
Binary Superset
Same as Superset, but the binary representations of the character are the
same in character set A and B
Subset
Only a subset of the characters in character set A are included in character
set B.
Binary Subset
Same as Subset, but the binary representations of the character are the
same in character set A and B
Database Migration Assistant for Unicode (DMU) 1/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Migrates databases from legacy character sets to Unicode
– A GUI guides through all steps of the migration process
Validation mode for existing Unicode databases
– Searches for not correctly encoded characters
Version 2.2 was released in November 2017
– Support for JDK 8
– New command-line scanner (DMU-CLS) for scanning databases and generating reports
Since version 2.1.1 only database versions 11.2.0.4 and higher are supported
– For older database versions, you have to use version 2.1.0 (Patch 21138450)
Only supported tool for character set migration in 12c and higher
– Replaces CSSCAN and CSALTER
– Can only migrate databases to Unicode
Database Migration Assistant for Unicode (DMU) 2/2
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Download from Oracle Technology Network or My Oracle Support
– OTN version: OTN Developer License (Evaluation)
http://www.oracle.com/technetwork/database/database-
technologies/globalization/dmu
– MOS version: Program Update under the Database Support Contract (Migration) -
Patch #27084436
Requires the installation of the Java Development Kit 8
Requirements
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Oracle Database must be 10.2.0.4 (11.2.0.4) or higher
– Installed XML Database feature
– DBMS_DUMA_INTERNAL package
ASCII-based character set
Oracle Database Vault must be disabled
Data Dictionary must contain ASCII characters only
No Flashback archives can exist
Data that requires conversions …
– … cannot reside in read-only or offline tablespaces
– … can be present in tables in the recycle bin
– … can be present in reference partitioning key column
SQL> @?/rdbms/admin/prvtdumi.plb
Repository Configuration Wizard
MythBusters Globalization Support - Avoid Data Corruption15.09.201915.09.2019 MythBusters Globalization Support - Avoid Data Corruption
Migration
MythBusters Globalization Support - Avoid Data Corruption15.09.201915.09.2019 MythBusters Globalization Support - Avoid Data Corruption
MythBusters Globalization Support - Avoid Data Corruption15.09.2019
Database Globalization Support Guide 12c Release 2
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/nlspg/index.html
Database Globalization Support Guide 18c
https://docs.oracle.com/en/database/oracle/oracle-database/18/nlspg/index.html
My Oracle Support Notes - https://support.oracle.com
264157.1 The Correct NLS_LANG Setting in Unix Environments
179133.1 The Correct NLS_LANG in a Microsoft Windows Environment
179133.1 NLS_LANG Explained (How does Client-Server Character Conversion Work?)
241047.1 The Priority of NLS Parameters Explained (Where To Define NLS Parameters)
Christian Gohmann
Senior Consultant
Tel. +49-211-58 6664 702
christian.gohmann@trivadis.com
15.09.2019 MythBusters Globalization Support - Avoid Data Corruption
Trivadis @ DOAG 2018
#opencompany
Booth: 3rd Floor – next to the escalator
We share our Know how!
Just come across, Live-Presentations
and documents archive
T-Shirts, Contest and much more
We look forward to your visit
15.09.2019 MythBusters Globalization Support - Avoid Data Corruption

More Related Content

PDF
REST in Piece - Administration of an Oracle Cluster/Database using REST
PDF
IaC MeetUp Active Directory Setup for Oracle Security LAB
PDF
AUSOUG Oracle Password Security
PDF
Security Best Practice: Oracle passwords, but secure!
PDF
TechEvent 2019: Oracle PDB Isolation and Security; Stefan Oehrli - Trivadis
PDF
12 Things about Oracle WebLogic Server 12c
PDF
DOAG Oracle Database Vault
PDF
Oracle Drivers configuration for High Availability, is it a developer's job?
REST in Piece - Administration of an Oracle Cluster/Database using REST
IaC MeetUp Active Directory Setup for Oracle Security LAB
AUSOUG Oracle Password Security
Security Best Practice: Oracle passwords, but secure!
TechEvent 2019: Oracle PDB Isolation and Security; Stefan Oehrli - Trivadis
12 Things about Oracle WebLogic Server 12c
DOAG Oracle Database Vault
Oracle Drivers configuration for High Availability, is it a developer's job?

What's hot (20)

PDF
SOUG Day Oracle 21c New Security Features
PPTX
Oracle Database 12.1.0.2: New Features
PDF
TechEvent 2019: Oracle Databases as Managed Service at AWS, Yes it works!; Al...
PPTX
Oracle Database 12c New Features for Developers and DBAs - OTN TOUR LA 2015
PPT
Oracle Active Data Guard 12c New Features
PDF
RMAN best practices for RAC
PDF
SOUG PDB Security, Isolation and DB Nest 20c
PPTX
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
PDF
What's next after Upgrade to 12c
PDF
UKOUG TechFest PDB Isolation and Security
PDF
Using VirtualBox - Learn Oracle Database 12c and EBS R12
PDF
Oracle 21c: New Features and Enhancements of Data Pump & TTS
PDF
Create non-cdb (traditional) oracle database 12c on windows
PPTX
Oracle 12c Multi Tenant
PDF
Crating a Robust Performance Strategy
PPTX
Database 12c is ready for you... Are you ready for 12c?
PDF
Oracle 12c New Features_RAC_slides
PDF
MySQL 5.7 in a Nutshell
PPTX
Oracle 12c - Multitenant Feature
PDF
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
SOUG Day Oracle 21c New Security Features
Oracle Database 12.1.0.2: New Features
TechEvent 2019: Oracle Databases as Managed Service at AWS, Yes it works!; Al...
Oracle Database 12c New Features for Developers and DBAs - OTN TOUR LA 2015
Oracle Active Data Guard 12c New Features
RMAN best practices for RAC
SOUG PDB Security, Isolation and DB Nest 20c
Oracle Unified Directory. Lessons learnt. Is it ready for a move from OID? (O...
What's next after Upgrade to 12c
UKOUG TechFest PDB Isolation and Security
Using VirtualBox - Learn Oracle Database 12c and EBS R12
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Create non-cdb (traditional) oracle database 12c on windows
Oracle 12c Multi Tenant
Crating a Robust Performance Strategy
Database 12c is ready for you... Are you ready for 12c?
Oracle 12c New Features_RAC_slides
MySQL 5.7 in a Nutshell
Oracle 12c - Multitenant Feature
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
Ad

Similar to MythBusters Globalization Support - Avoid Data Corruption (15)

PDF
Oracle Globalization Support, NLS_LENGTH_SEMANTICS, Unicode
PPTX
When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...
PPTX
When 7-bit ASCII ain't enough - about NLS, Collation, Charsets, Unicode and such
PPTX
DB2 and Codepages
PDF
E-Business Suite 1 _ Jim Pang _ The anatomy of multiple language support (MLS...
PDF
Character Encoding - MySQL DevRoom - FOSDEM 2015
DOC
Steps for upgrading the database to 10g release 2
KEY
Character sets
PPT
Less03 db dbca
PPTX
PDF
2019-Db2-From_ASCII_to_UTF-8.pdf
PDF
MySQL 8.0 & Unicode: Why, what & how
PDF
20180324 leveraging unix tools
PPT
Internationalisation And Globalisation
Oracle Globalization Support, NLS_LENGTH_SEMANTICS, Unicode
When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...
When 7-bit ASCII ain't enough - about NLS, Collation, Charsets, Unicode and such
DB2 and Codepages
E-Business Suite 1 _ Jim Pang _ The anatomy of multiple language support (MLS...
Character Encoding - MySQL DevRoom - FOSDEM 2015
Steps for upgrading the database to 10g release 2
Character sets
Less03 db dbca
2019-Db2-From_ASCII_to_UTF-8.pdf
MySQL 8.0 & Unicode: Why, what & how
20180324 leveraging unix tools
Internationalisation And Globalisation
Ad

Recently uploaded (20)

PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
top salesforce developer skills in 2025.pdf
PPTX
Essential Infomation Tech presentation.pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Transform Your Business with a Software ERP System
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Introduction to Artificial Intelligence
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
history of c programming in notes for students .pptx
PDF
System and Network Administration Chapter 2
PDF
Nekopoi APK 2025 free lastest update
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
Which alternative to Crystal Reports is best for small or large businesses.pdf
Wondershare Filmora 15 Crack With Activation Key [2025
VVF-Customer-Presentation2025-Ver1.9.pptx
PTS Company Brochure 2025 (1).pdf.......
How to Choose the Right IT Partner for Your Business in Malaysia
top salesforce developer skills in 2025.pdf
Essential Infomation Tech presentation.pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Design an Analysis of Algorithms I-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Transform Your Business with a Software ERP System
Operating system designcfffgfgggggggvggggggggg
Introduction to Artificial Intelligence
Odoo POS Development Services by CandidRoot Solutions
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
history of c programming in notes for students .pptx
System and Network Administration Chapter 2
Nekopoi APK 2025 free lastest update
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
How to Migrate SBCGlobal Email to Yahoo Easily

MythBusters Globalization Support - Avoid Data Corruption

  • 1. MythBusters Globalization Support Avoid Data Corruption Christian Gohmann @CGohmannDE DOAG2018
  • 2. About me… MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Christian Gohmann Senior Consultant at Trivadis GmbH, Düsseldorf (Germany) Instructor since 2014 – O-AI (Oracle Architecture and Internals) – O-AI-DBA (Oracle Architecture and Internals for DBAs) Tool Owner of TVD-Backup Experiences with Oracle since 2006 (8i – 18c) – Architecture, Installation & Configuration – High Availability Solutions (RAC, Data Guard) – Migration Projects – Backup & Recovery (RMAN, Data Pump) Blog: http://www.christian-gohmann.de
  • 3. We help to generate added value from data MythBusters Globalization Support - Avoid Data Corruption15.09.2019
  • 4. With over 650 specialists and IT experts in your region. MythBusters Globalization Support - Avoid Data Corruption15.09.2019 16 Trivadis branches and more than 650 employees Experience from more than 1,900 projects per year at over 800 customers 250 Service Level Agreements Over 4,000 training participants Research and development budget: CHF 5.0 million Financially self-supporting and sustainably profitable
  • 5. Agenda MythBusters Globalization Support - Avoid Data Corruption15.09.2019 1. Fundamentals 2. Configuration 3. Conversion 4. Tools 5. Debugging 6. Migration
  • 6. MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Fundamentals
  • 7. Globalization Support MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Store, process and retrieve data in native languages – Allows the development of multilingual applications Former known as National Language Support (NLS) – Subset of the Globalization Support Implemented with the Oracle NLS Runtime Library (NLSRTL) – Functions for text and character processing and manipulations Locale-specific data is stored in $ORACLE_HOME/nls/data – Use ORA_NLS10 environment variable to choose a different location – Loaded as independent set at runtime
  • 8. Language Support MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Refers to the additional language-dependent functionalities – Display dates using translated month names – Sort text according to cultural conventions – Translated error messages and user interfaces Only available for a subset of the languages Parameter: NLS_LANGUAGE “Language Support means the ability to store text of a specific language” SQL> ALTER SESSION SET nls_language = 'FRENCH'; BUSTED
  • 9. Territory Support MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Has nothing to do with the ability to store characters in the database Support of cultural conventions, specific to geographical locations – Default local time format – Date format – Numeric and monetary conventions Parameter: NLS_TERRITORY “Territory support allows the database to store characters of different languages” SQL> ALTER SESSION SET nls_territory = 'FRANCE'; BUSTED
  • 10. Character Set Support 1/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 "A Character Set maps a number to a characters visual representation." Two character sets are defined at database creation National Character Set to store Unicode – Limited to NCHAR, NVARCHAR2 and NCLOB data types Oracle naming convention (except UTF8 and UTFE) – <Region><Bit length><Standard Character Set Name>[S|C] – Optional: S → Server, C → Client – Example: WE8ISO8859P15 SQL> CREATE DATABASE TEST ( … CHARACTER SET WE8MSWIN2152 NATIONAL CHARACTER SET AL16UTF16 );
  • 11. Character Set Support 2/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Windows character sets like WE8MSWIN1252 can be used on Unix – EBCDIC character sets cannot be used on ASCII platforms and vice-versa "Windows character sets are limited to the Windows platform" BUSTED
  • 12. Calendar Systems MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Support of eight different calendar systems Switch to a different calendar NLS Calendar Utility can be used to register calendar modifications (*.nlt files) Name Name Gregorian Japanese Imperial ROC Official (Republic of China) Thai Buddha Persian English Hijrah Arabic Hijrah Ethiopian SQL> ALTER SESSION SET nls_calendar = 'Persian'; $> lxegen
  • 13. Unicode Support MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Support of the Unicode standard since Oracle 7 Two ways to store Unicode characters in the database – Create a database with a Unicode character set (e.g. UTF8) – Support multilingual data in specific columns (NCHAR, NVARCHAR, NCLOB) Oracle recommends the usage of AL32UTF8 (default since Oracle 12c Release 2) Database Migration Assistant for Unicode (DMU) Oracle Version Unicode Version 10g 4.0 11g 5.0 12c 6.2 / 7.0 18c 9.0
  • 14. Enhancements in 12c and 18c MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Oracle 12c Support for Unicode 6.2 / 7.0 (12c Release 2) Support for 12 new languages and 32 new territories Support for the Unicode Collation Algorithm (UCA) Support for Pluggable Databases with different Character Sets Column Level Collation (Case-insensitive Database) Desupport of CSSCAN and CSALTER for migration to Unicode – Instead use Database Migration Assistant for Unicode (DMU) Oracle 18c Support for Unicode 9.0 Support for 3 new languages and 31 new territories
  • 15. MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Configuration
  • 16. General MythBusters Globalization Support - Avoid Data Corruption15.09.2019 A new session initializes the NLS environment from the NLS instance parameters – If specific client-side NLS settings are given, an ALTER SESSION is executed Check V$NLS_VALID_VALUES for valid values of NLS settings Direct connection from the server acts like a client connection Set NLS_% parameter on instance level requires restart of instance SQL> ALTER SYSTEM SET nls_date_format = 'YYYY-MM-DD HH24:MI' SCOPE=SPFILE;
  • 17. Client 1/3 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 NLS_LANG only represents the character set that the client use – Example: German Windows client → GERMAN_GERMANY.WE8MSWIN1252 – Example: Unix client with Unicode locale → AMERICAN_AMERICA.UTF8 It can be the same, but it is not a must It is required for proper conversion If client and server character sets match, then no validation is enforced “NLS_LANG must match the character set of the database server” BUSTED
  • 18. Client 2/3 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 If not set it defaults to the hardcoded value US7ASCII Registry key: HKLMSOFTWAREORACLEKEY_<Oracle Home Name> “If NLS_LANG is not set it uses the NLS_LANG of the database server” SQL> ! echo $NLS_LANG SQL> SELECT client_charset, network_service_banner FROM v$session_connect_info WHERE sid = SYS_CONTEXT('USERENV', 'SID'); CLIENT_CHARSET NETWORK_SERVICE_BANNER -------------- ------------------------------------------------------------------------------ US7ASCII Oracle Bequeath NT Protocol Adapter for Linux: Version 12.1.0.1.0 - Production US7ASCII Authentication service for Linux: Version 12.1.0.1.0 - Production US7ASCII Encryption service for Linux: Version 12.1.0.1.0 - Production US7ASCII Crypto-checksumming service for Linux: Version 12.1.0.1.0 - Production BUSTED
  • 19. Client 3/3 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Setting NLS_LANG changes nothing on the client The character set can only be changed with operating system tools “Setting NLS_LANG changes the character set of the client” # Change Locale on Linux $> export LANG=de_DE.CP1252 $> locale LANG=de_DE.CP1252 LC_CTYPE="de_DE.CP1252" … LC_IDENTIFICATION="de_DE.CP1252" BUSTED
  • 20. Miscellaneous MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Different tools or input files require specific NLS_LANG settings Tool NLS_LANG Comment SQL Loader / SQL Developer Character set of the text/flat file UTL_FILE Does not use it Runs in the database. Assume encoding of the input file is in the character set of the database. Otherwise use UTL_RAW.CONVERT Export Same as the database character set No character conversion Import Character set of the source database Check with imp .. show=yes Data Pump Not affected by the NLS_LANG setting. Only used for the parameter file. SQLcl Does not evaluate NLS_LANG. Because SQLcl is a Java program, it evaluates environment variable LANG (except Windows)
  • 21. MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Conversion
  • 22. Character Conversion MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Normally conversion is done at client side (OCI driver) – 8.0.4 onwards If character set is not known at client side, server side will do conversion – 8.1.6 onwards If server and client side character sets are the same, no validation will be performed – Increased performance – Chance to write data garbage
  • 23. Character Lifecycle MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Database WEISO8859P15 Client / Tool WE8MSWIN1252 Codepage 1252 Insert "€" Translate "€" → 128 (20AC) Convert codepage 128 → 164 Send codepage 164 User
  • 24. Special Characters MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Some character sets offers mappings from unknown characters to known characters – E.g. é → e, ä → a Character Description □ The used font has no graphical representation for the codepage ¿ Replacement character that is used for unknown characters in the character set
  • 25. MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Tools
  • 26. SQL*Plus 1/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 SQL*Plus in a DOS box does not use the regular Windows codepage – Instead it uses the OEM environment (e.g. codepage 850) – Character set part of NLS_LANG must be set to WE8PC850 – Alternatively change codepage using chcp and set different font “The codepage of running SQL*Plus in a DOS box differs from the regular operating system codepage" $> chcp Active Codepage: 850 $> chcp 1252 CONFIRMED
  • 27. SQL*Plus 2/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Until Oracle 10g an ANSI version of SQL*Plus (sqlplusw.exe) exists – Uses the configured Windows codepage (e.g. 1252) – Officially replaced by the SQL Developer On Windows only: SQL*Plus is not UTF8/Unicode aware
  • 28. SQL Developer 1/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 SQL Developer needs no client side NLS configuration – Unicode client Download from Oracle Technology Network (OTN) – http://www.oracle.com/technetwork/developer-tools/sql-developer Change font if □ characters appear in the output – Reason: The used font cannot display the character – Tools > Preferences > Code-Editor > Fonts
  • 29. SQL Developer 2/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Change specific NLS settings of the SQL Developer session – Tools > Preferences > Database > NLS – Changes will be applied immediately
  • 30. Telnet/SSH Client MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Responsible for conversion of the Unix locale to the client's environment – Translation settings must match the encoding of the Unix Shell Example: Connection to an en_EN.ISO8859-15 Unix Shell with PuTTY
  • 31. Locale Builder 1/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 View, modify or create Language, Territory, Character Set or Linguistic Sort definitions Available since Oracle 9i – Windows: %ORACLE_HOME%nlslbuilderlbuilder.exe – Unix: $ORACLE_HOME/nls/lbuilder/lbuilder Open NLS locale data definitions using file or object name
  • 32. Locale Builder 2/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019
  • 33. MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Debugging
  • 34. General 1/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Check data with a Unicode client like SQL Developer Check NLS settings on different levels Client character set is visible in the V$SESSION_CONNECT_INFO view – Available since 11g Release 1 SQL> SELECT * FROM nls_database_parameters; SQL> SELECT * FROM nls_instance_parameters; SQL> SELECT * FROM nls_session_parameters; -- Current session SQL> SELECT client_charset, network_service_banner FROM v$session_connect_info WHERE sid = SYS_CONTEXT('USERENV', 'SID');
  • 35. General 2/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Get NLS_LANG value set in Registry only SQL> host echo %NLS_LANG% %NLS_LANG% SQL> @.[%NLS_LANG%]. SP2-0310: Unable to open file ".[GERMAN_GERMANY.WE8MSWIN1252]..sql"
  • 36. Character Set Health Check MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Use CSSCAN utility to search for incompatible characters (< 12c) – Requires a schema called CSMIG to store internal data Run CSSCAN as SYSDBA – Set FROMCHAR and TOCHAR to the same value Check cs_healthceck.txt for "Convertible" or "Lossy" entries – If no entries exist, the current data is fine SQL> @?/rdbms/admin/csminst.sql $> csscan FULL=Y FROMCHAR=WE8ISO8859P1 TOCHAR=WE8ISO8859P1 ARRAY=1024000 LOG=cs_healthcheck CAPTURE=Y PROCESS=4
  • 37. DUMP Function MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Returns datatype code, length (bytes) and internal representation Supports CHAR, VARCHAR2, NCHAR, NVARCHAR2, DATE, NUMBER – Cannot be used on CLOB or NCLOB columns Useful to check if a specific character is supported – Requires the usage of an Unicode client like SQL Developer – If an insert in a table succeeded the Character Set supports the character SQL> SELECT DUMP(col1, 10) FROM tab1; SQL> SELECT DUMP('Text with € sign', 10, 1, 10) FROM dual;
  • 38. MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Migration
  • 39. Superset vs. Subset MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Character set can be a Superset or a Subset of the new character set Type Description Superset All characters from character set A are included in character set B. Binary Superset Same as Superset, but the binary representations of the character are the same in character set A and B Subset Only a subset of the characters in character set A are included in character set B. Binary Subset Same as Subset, but the binary representations of the character are the same in character set A and B
  • 40. Database Migration Assistant for Unicode (DMU) 1/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Migrates databases from legacy character sets to Unicode – A GUI guides through all steps of the migration process Validation mode for existing Unicode databases – Searches for not correctly encoded characters Version 2.2 was released in November 2017 – Support for JDK 8 – New command-line scanner (DMU-CLS) for scanning databases and generating reports Since version 2.1.1 only database versions 11.2.0.4 and higher are supported – For older database versions, you have to use version 2.1.0 (Patch 21138450) Only supported tool for character set migration in 12c and higher – Replaces CSSCAN and CSALTER – Can only migrate databases to Unicode
  • 41. Database Migration Assistant for Unicode (DMU) 2/2 MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Download from Oracle Technology Network or My Oracle Support – OTN version: OTN Developer License (Evaluation) http://www.oracle.com/technetwork/database/database- technologies/globalization/dmu – MOS version: Program Update under the Database Support Contract (Migration) - Patch #27084436 Requires the installation of the Java Development Kit 8
  • 42. Requirements MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Oracle Database must be 10.2.0.4 (11.2.0.4) or higher – Installed XML Database feature – DBMS_DUMA_INTERNAL package ASCII-based character set Oracle Database Vault must be disabled Data Dictionary must contain ASCII characters only No Flashback archives can exist Data that requires conversions … – … cannot reside in read-only or offline tablespaces – … can be present in tables in the recycle bin – … can be present in reference partitioning key column SQL> @?/rdbms/admin/prvtdumi.plb
  • 43. Repository Configuration Wizard MythBusters Globalization Support - Avoid Data Corruption15.09.201915.09.2019 MythBusters Globalization Support - Avoid Data Corruption
  • 44. Migration MythBusters Globalization Support - Avoid Data Corruption15.09.201915.09.2019 MythBusters Globalization Support - Avoid Data Corruption
  • 45. MythBusters Globalization Support - Avoid Data Corruption15.09.2019 Database Globalization Support Guide 12c Release 2 https://docs.oracle.com/en/database/oracle/oracle-database/12.2/nlspg/index.html Database Globalization Support Guide 18c https://docs.oracle.com/en/database/oracle/oracle-database/18/nlspg/index.html My Oracle Support Notes - https://support.oracle.com 264157.1 The Correct NLS_LANG Setting in Unix Environments 179133.1 The Correct NLS_LANG in a Microsoft Windows Environment 179133.1 NLS_LANG Explained (How does Client-Server Character Conversion Work?) 241047.1 The Priority of NLS Parameters Explained (Where To Define NLS Parameters)
  • 46. Christian Gohmann Senior Consultant Tel. +49-211-58 6664 702 christian.gohmann@trivadis.com 15.09.2019 MythBusters Globalization Support - Avoid Data Corruption
  • 47. Trivadis @ DOAG 2018 #opencompany Booth: 3rd Floor – next to the escalator We share our Know how! Just come across, Live-Presentations and documents archive T-Shirts, Contest and much more We look forward to your visit 15.09.2019 MythBusters Globalization Support - Avoid Data Corruption