_oracle System _ with the Tang notes 013-Character Set

Source: Internet
Author: User

In the Linux environment:[Email protected] ~]# Localelang=en_us. Utf-8lc_ctype= "en_US. UTF-8 "...In the Windows environment:C:\USERS\MARTIN>CHCP Activity code page: 936 a character set is actually a table of "characters" and "encodings",During the database installation process, the following two character sets are selected: 1. Database Character set: Database needs to store multi-language selection Al32utf8, only Chinese and English choose Zhs16gbk2. The national character set generally chooses the Al16utf16 Unicode character set: UTF8 is very old, No, it's not. Al32utf8 is currently the latest, recommended. Note: The actual production environment, if the database is only for the Chinese use (only in English-related characters), the use of ZHS16GBK. Sql*plus ClientSetup principle: Consistent with the character set of your operating system): Windows: Generally GBK, that is, the chcp result is 936set NLS_LANG=AMERICAN_AMERICA.ZHS16GBK language and region for Chinese, set nls_lang=simplified chinese_ China.zhs16gbklinux: Generally utf-8, that is, echo $LANG result is en_US. UTF-8 or ZH_CN. Utf-8export Nls_lang=american_america.utf8 test: Client Linux, the system character set is ZH_CN. UTF-8 correct settings: Export nls_lang=american_america.utf8select dump (' Jingyu ', 1016) from Dual;insert to T2 values (1, ' Jingyu '); commit; Error settings: Export nls_lang=american_america.zhs16gbkselect dump (' Jingyu ', 1016) from Dual;insert to T2 values (2, ' Jingyu '); commit; Note: Character set errors cause the library to store the wrong encoding, which is almost irreversible ' be sure to carefully set up the character set well. Oracle Character set on serverHow to determine the current character set and when the character set can be changed.
Select Userenv (' language ') from dual;
SELECT * from V$nls_parameters;

Understand the concept of hyper-set, strict superset, and determine whether character sets can be changed. Oracle does not recommend late changes to the database character set!

Server operating system character set (temporarily ignored)

PS:1. Because the sql*plus itself does not have a character set, it relies on the character set of the operating system, and Oracle on the far end of Linux is not directly accessible to the character set on Windows, so it relies on Sql*plus's nls_lang settings to distinguish it. 2. Because the Oracle software itself has a character set, when the software has its own character set, it does not use the operating system's character set, so the elements of the server operating system character set can be temporarily ignored.

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.