Setting and modification of three levels of DB2 database character set

Source: Internet
Author: User
Tags character set db2 locale create database

In the DB2 database, the problem with the character set is primarily the setting of three levels of character set, where system-level and instance-level character sets can be modified according to requirements, while database-level datasets must be determined when the library is being built.

(1) Operating system Locale: System-Level code page settings, determining the application's default code page;

If you want to set the OS Locale to Chinese, consider the following method:

UNIX: You can modify the current Locale to Chinese through the export lang= "ZH_CN" command;

Windows: Select the language settings for the system in the Start-> Settings-> Control Panel-> Regional options;

(2) DB2CODEPAGE:DB2 instance-Level code page settings that affect DB2-related applications to make code page decisions when converting code pages.

You can set the Db2codepage to the character set you want through the Db2set db2codepaeg= command.

(3) Database codepage:db2 The code page settings at the DB level, and must be set when the library is being built.

You must specify the code page you want when you create the database:

db2 "CREATE DATABASE dbname USING CODESET UTF-8 TERRITORY CN"

Note: This statement can be used to create a Unicode database for the specified region as China (CN).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.