Settings and modification of three levels of DB2 database character sets

Source: Internet
Author: User

Guidance:InDB2 databaseIn, Character Set-related problems mainly include three levels of Character Set settings, in which the system-level and instance-level character sets can be modified as needed, database-level datasets must be determined during database creation.

(1) Operating System Locale: system-level code page setting determines the default code page of the application;

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

Unix: You can use the export LANG = "zh_CN" command to modify the current Locale to Chinese;

Windows: Choose "start"> "Settings"> "Control Panel"> "region options" to set the system language;

(2) DB2CODEPAGE: the code page setting at the DB2 instance level, which affects the DB2 application to determine the code page when converting the code page.

You can use the db2set DB2CODEPAEG = command to set DB2CODEPAGE to the character set you need.

(3) database codepage: Specifies the DB2 DATABASE-level code page. It must be set at the time of DATABASE creation.

When creating a database, you must specify the required code page:

Db2 "create database dbname using codeset UTF-8 territory cn"

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

I hope that the content described above will be helpful to you and you will be able to gain some benefits after reading it.

Related Article

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.