20 Copyright © 2008, Oracle. All rights reserved. Globalization.

Slides:



Advertisements
Similar presentations
The creation of "Yaolan.com" A Site for Pre-natal and Parenting Education in Chinese by James Caldwell DAE Interactive Marketing a Web Connection Company.
Advertisements

9 Creating and Managing Tables. Objectives After completing this lesson, you should be able to do the following: Describe the main database objects Create.
Data Definition Language (DDL)
18 Copyright © Oracle Corporation, All rights reserved. Transporting Data Between Databases.
NorCal OAUG Training Day, Pres 5.09John Peters, JRPJR, Inc.1 So you want Multiple Languages in your Oracle E-Business Suite John Peters JRPJR, Inc.
Copyright  Oracle Corporation, All rights reserved. 10 Creating and Managing Tables.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
2 Copyright © 2004, Oracle. All rights reserved. Restricting and Sorting Data.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
1 Nassau Community CollegeProf. Vincent Costa Acknowledgements: Introduction to Database Management, All Rights ReservedIntroduction to Database Management.
Oracle9 i Datetime Functions Fresher Learning Program January, 2012.
Module 2: Using Transact-SQL Querying Tools. Overview SQL Query Analyzer Using the Object Browser Tool in SQL Query Analyzer Using Templates in SQL Query.
Sophia Antipolis, September 2006 Multilinguality, localization and internationalization Miruna Bădescu Finsiel Romania.
Chapter 3 Single-Table Queries
Chapter 6 Additional Database Objects
1 Copyright © 2006, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
2 Copyright © 2004, Oracle. All rights reserved. Restricting and Sorting Data.
10 Copyright © 2009, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Database control Introduction. The Database control is a tool that used by the database administrator to control the database. To enter to Database control.
10 Creating and Managing Tables Objectives At the end of this lesson, you will be able to: Describe the main database objects Create tables Describe.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
Copyright  Oracle Corporation, All rights reserved. 10 Creating and Managing Tables.
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 14 Globalization Support in the Database.
3 Copyright © 2009, Oracle. All rights reserved. Creating an Oracle Database Using DBCA.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 8 Advanced SQL.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Manipulating Data in PL/SQL. 2 home back first prev next last What Will I Learn? Construct and execute PL/SQL statements that manipulate data with DML.
Database Application Development using PL/SQL Programming.
Guide to Oracle 10g ITBIS373 Database Development Lecture 4a - Chapter 4: Using SQL Queries to Insert, Update, Delete, and View Data.
12 Copyright © 2004, Oracle. All rights reserved. Understanding and Influencing the PL/SQL Compiler.
Siebel CRM Unicode Conversion – The DBA Perspective Brian Hitchcock OCP 8, 8i, 9i DBA Sun Microsystems DCSIT Technical.
Week 7 Lecture 2 Globalization Support in the Database.
D Copyright © Oracle Corporation, All rights reserved. Loading Data into a Database.
16 Copyright © 2006, Oracle. All rights reserved. Using Globalization Support.
Conversion Functions.
2 Copyright © 2004, Oracle. All rights reserved. Restricting and Sorting Data.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
15 Copyright © Oracle Corporation, All rights reserved. Using SET Operators.
8 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
Copyright © 2004, Oracle. All rights reserved. Using the Set Operators.
A Guide to SQL, Eighth Edition Chapter Eight SQL Functions and Procedures.
2 Copyright © 2004, Oracle. All rights reserved. Using Globalization Support.
1 Copyright © Oracle Corporation, All rights reserved. Writing Basic SQL SELECT Statements.
2 Copyright © 2009, Oracle. All rights reserved. Restricting and Sorting Data.
Declaring PL/SQL Variables
21 Copyright © 2009, Oracle. All rights reserved. Working with Oracle Business Intelligence Answers.
Gollis University Faculty of Computer Engineering Chapter Five: Retrieval, Functions Instructor: Mukhtar M Ali “Hakaale” BCS.
C Copyright © 2006, Oracle. All rights reserved. Integrating with Oracle Streams.
8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects.
13 Copyright © 2004, Oracle. All rights reserved. Migrating SQL Statements.
7 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.
6 Copyright © 2009, Oracle. All rights reserved. Using Dynamic SQL.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
1 Copyright © 2004, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
Creating Database Objects
Introduction To Oracle
Using Globalization Support
Using the Set Operators
Using the Set Operators
DATABASE MANAGEMENT SYSTEM
Creating Noninput Items
Contents Preface I Introduction Lesson Objectives I-2
Chapter 8 Advanced SQL.
Using SQL*Plus.
IST 318 Database Administration
Using the Set Operators
Creating Database Objects
Presentation transcript:

20 Copyright © 2008, Oracle. All rights reserved. Globalization

Copyright © 2008, Oracle. All rights reserved Objectives After completing this lesson, you should be able to: Determine a correct database character set that meets your business requirements Obtain globalization support configuration information Customize language-dependent behavior for the database and individual sessions Specify different linguistic sorts for queries Retrieve data that matches a search string ignoring case or accent differences

Copyright © 2008, Oracle. All rights reserved Globalization Support Features Language support Territory support Character set support Linguistic sorting Message support Date and time formats Numeric formats Monetary formats French data Japanese data

Copyright © 2008, Oracle. All rights reserved What Every DBA Needs to Know What is a character set? How are character sets used? Problems to avoid Choosing your character set Obtaining character set information Specifying language-dependent behavior Using linguistic searching and sorting Using data conversion

Copyright © 2008, Oracle. All rights reserved What Is a Character Set? The Oracle database supports different classes of character- encoding schemes: Single-byte character sets –7-bit –8-bit Multibyte character sets, including Unicode

Copyright © 2008, Oracle. All rights reserved Character Sets Full Notes Page

Copyright © 2008, Oracle. All rights reserved Understanding Unicode Supplementary characters AL32UTF8AL16UTF16 63 EEAA9E F09D849E 64 C3 D0A4 B6 á t d ö E A89E D834DD1E F c C Encoding: Representing characters with byte sequences

Copyright © 2008, Oracle. All rights reserved Understanding Unicode Encodings Full Notes Page

Copyright © 2008, Oracle. All rights reserved How Are Character Sets Used? Oracle Net compares the client NLS_LANG setting to the character set on the server. If needed, conversion occurs automatically and transparently. Client Oracle Net NLS_LANG Server

Copyright © 2008, Oracle. All rights reserved Problems to Avoid Example: No conversion occurs, because it does not seem to be required. Issue: Invalid data are entered into the database. Server Database character set: AL32UTF8 Client Windows English Code page: WE8MSWIN1252 NLS_LANG: AL32UTF8 Oracle Net

Copyright © 2008, Oracle. All rights reserved CREATE DATABASE... CHARACTER SET US7ASCII NATIONAL CHARACTER SET UTF8... % export NLS_LANG=‘SIMPLIFIED CHINESE_HONG KONG.ZHS16GBK’ Another Sample Problem

Copyright © 2008, Oracle. All rights reserved Choosing Your Character Set Trade-offs to consider Choosing the correct character set that meets your business requirements now and in the future Specifying the character set Changing the character set after database creation

Copyright © 2008, Oracle. All rights reserved Database Character Sets and National Character Sets Database Character SetsNational Character Sets Defined at creation time Cannot be changed without re-creation (exceptions in certain configurations) Can be exchanged Store data columns of type CHAR, VARCHAR2, CLOB, LONG Store data columns of type NCHAR, NVARCHAR2, NCLOB Can store varying-width character sets Can store Unicode using either AL16UTF16 or UTF8

Copyright © 2008, Oracle. All rights reserved Obtaining Character Set Information SQL> SELECT parameter, value 2 FROM nls_database_parameters 3 WHERE parameter LIKE '%CHARACTERSET%'; PARAMETER VALUE NLS_CHARACTERSET WE8ISO8859P1 NLS_NCHAR_CHARACTERSET AL16UTF16 2 rows selected.

Copyright © 2008, Oracle. All rights reserved SELECT sysdate FROM dual; Initialization parameters for the database server Environment variables for the clients ALTER SESSION command Specifying Language-Dependent Behavior SQL function

Copyright © 2008, Oracle. All rights reserved Specifying Language-Dependent Behavior for the Session Specify the locale behavior with the NLS_LANG environment variable: –Language –Territory –Character set Set other NLS environment variables to: –Override database initialization parameter settings for all sessions –Customize the locale behavior –Change the default location of the NLS library files NLS_LANG=FRENCH_CANADA.WE8ISO8859P1

Copyright © 2008, Oracle. All rights reserved Language-Dependent and Territory-Dependent Parameters ParameterDefault Values NLS_LANGUAGE NLS_DATE_LANGUAGE NLS_SORT AMERICAN BINARY NLS_TERRITORY NLS_CURRENCY NLS_DUAL_CURRENCY NLS_ISO_CURRENCY NLS_DATE_FORMAT NLS_NUMERIC_CHARACTERS NLS_TIMESTAMP_FORMAT NLS_TIMESTAMP_TZ_FORMAT AMERICA $ AMERICA DD-MON-RR., DD-MON-RRHH.MI.SSXFF AM DD-MON-RRHH.MI.SSXFF AM TZR

Copyright © 2008, Oracle. All rights reserved Language- and Territory-Dependent Parameters Full Notes Page

Copyright © 2008, Oracle. All rights reserved ALTER SESSION SET NLS_DATE_FORMAT='DD.MM.YYYY'; DBMS_SESSION.SET_NLS('NLS_DATE_FORMAT', '''DD.MM.YYYY''') ; Specifying Language-Dependent Behavior Using NLS parameters in SQL functions: SELECT TO_CHAR(hire_date,'DD.Mon.YYYY', 'NLS_DATE_LANGUAGE=FRENCH') FROM employees WHERE hire_date > '01-JAN-2000';

Copyright © 2008, Oracle. All rights reserved Linguistic Searching and Sorting Sort order can be affected by: Case-sensitivity Diacritics or accent characters Combination of characters that is treated as a single character Phonetics or character appearance Cultural preferences

Copyright © 2008, Oracle. All rights reserved Linguistic Searching and Sorting Three types of sorting: Binary sorting –Sorted according to the binary values of the encoded characters Monolingual linguistic sorting –A two-pass sort based on a character’s assigned major and minor values Multilingual linguistic sorting –Based on the ISO standard (ISO 14651), and the Unicode 3.2 Standard for multilingual collation –Ordered by the number of strokes, PinYin, or radicals for Chinese characters

Copyright © 2008, Oracle. All rights reserved Using Linguistic Searching and Sorting You can specify the type of sort used for character data with the: NLS_SORT parameter –Default value derived from the NLS_LANG environment variable, if set –Can be specified for the session, client, or server NLSSORT function –Defines the sorting method at the query level

Copyright © 2008, Oracle. All rights reserved NLS Searching and Sorting Full Notes Page

Copyright © 2008, Oracle. All rights reserved Case-Insensitive and Accent-Insensitive Search and Sort Specify the linguistic name: Examples: Specify the sort action for WHERE clauses and PL/SQL blocks: Useful for migrated databases NLS_SORT = [_AI | _CI] NLS_SORT = FRENCH_M_AI NLS_SORT = XGERMAN_CI NLS_COMP = BINARY | ANSI

Copyright © 2008, Oracle. All rights reserved Support in SQL and Functions The following SQL clauses support NLS_SORT and NLS_COMP settings: – WHERE – ORDER BY – START WITH – HAVING – IN/NOT IN – BETWEEN – CASE-WHEN The NLSSORT() function supports the case-insensitive and accent-insensitive functionality.

Copyright © 2008, Oracle. All rights reserved Linguistic Index Support Create an index on linguistically sorted values. Rapidly query data without having to specify ORDER BY clause and NLSSORT : Set the NLS_SORT parameter to match the linguistic definition that you want to use for the linguistic sort when creating the index. CREATE INDEX list_word ON list (NLSSORT(word, 'NLS_SORT=French_M')); SELECT word FROM list;

Copyright © 2008, Oracle. All rights reserved Customizing Linguistic Searching and Sorting You can customize linguistic sorting for: Ignorable characters Contracting or expanding characters Special combination letters or special letters Expanding characters or special letters Special uppercase and lowercase letters Context-sensitive characters Reverse secondary sorting Canonical equivalence

Copyright © 2008, Oracle. All rights reserved Customizing Linguistic Searching and Sorting Full Notes Page

Copyright © 2008, Oracle. All rights reserved Implicit Conversion Between CLOB and NCLOB Transparent implicit conversion is supported in: SQL IN and OUT bind variables for query and DML PL/SQL functions and procedure parameter passing PL/SQL variable assignment

Copyright © 2008, Oracle. All rights reserved NLS Data Conversion with Oracle Utilities Multiple data conversions can take place when data is exported from one database and imported into another if the same character sets are not used. External tables use the NLS settings on the server for determining the data character set. SQL*Loader: –Conventional path: Data is converted into the session character set specified by NLS_LANG. –Direct path: Data is converted using client-side directives.

Copyright © 2008, Oracle. All rights reserved NLS Data Conversion with Oracle Utilities Full Notes Page

Copyright © 2008, Oracle. All rights reserved NLS Data Conversion with Data Pump Data Pump Export always saves data in the same character set as the database from which the data originates. Data Pump Import converts the data to the character set of the target database, if needed. The Data Pump log file is written in the language specified by NLS_LANG for the session that started Data Pump.

Copyright © 2008, Oracle. All rights reserved Language and Character Set File Scanner ( LCSSCAN ) Character set

Copyright © 2008, Oracle. All rights reserved Setting the Database Time Zone The current time zone in the database is determined by the following: The SET TIME_ZONE clause of the CREATE DATABASE statement The time zone of the operating system on the database server host The time zone specified by the ALTER SESSION SET TIME_ZONE command CREATE DATABASE... SET TIME_ZONE='-04:00';

Copyright © 2008, Oracle. All rights reserved Summary In this lesson, you should have learned how to: Determine a correct database character set that meets your business requirements Obtain globalization support configuration information Customize language-dependent behavior for the database and individual sessions Specify different linguistic sorts for queries Retrieve data that matches a search string ignoring case or accent differences

Copyright © 2008, Oracle. All rights reserved Practice 20 Overview: Using Globalization Support This practice covers the following topics: Determining the database character set Setting the NLS_SORT variable