Oracle Character Set

Source: Internet
Author: User

Oracle character set:
1. Solve the client issues temporarily. (Set the current environment variable to the same language as the system. Take oracle as the standard .) View the oracle Character Set SQL> select userenv ('language') from dual; USERENV ('language') using SIMPLIFIED CHINESE_CHINA.UTF8
View the linux Character Set [root @ ora ~] # Env | grep LANGLANG = zh_CN.UTF-8 www.2cto.com GDM_LANG = zh_CN.UTF-8 defines the linux system character set [root @ ora ~] # Export NLS_LANG = 'simplified chinese_china.utf8' defines the oracle environment character set [root @ ora ~] # Su-oracle [oracle @ ora ~] $ Export NLS_LANG = 'simplified chinese_china.utf8' [oracle @ ora ~] $! SQL query result SQL> select * from database_properties;
2. This is just the opposite. We have also written two methods below to modify oracle and OS (this is the same as General write, and we learned it together, please refer to changing the character set of the oracle client and the server in Linux.
1. in Linux, change the character set of the oracle client, that is, set the value of the environment variable "NLS_LANG" to view the character set of the client. Run echo $ NLS_LANG on the terminal to modify the character set of the client: sudo gedit/etc/environment Add the following content to the environment File: NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK" export NLS_LANG restart the operating system.
2. Modify the character set of the oracle server. View the server Character Set: select userenv ('language ') from dual; modify the server Character Set and run the following command on the terminal: $ ORACLE_HOME/bin/sqlplus/nolog enter sqlplus command line www.2cto.com SQL> conn/as sysdba; 1 ). shut down Database SQL> SHUTDOWN IMMEDIATE; 2 ). start MountSTARTUP MOUNT; alter system enable restricted session; alter system set JOB_QUEUE_PROCESSES = 0; alter system set AQ_TM_PROCESSES = 0; alter database open; alter database character set INTERNAL_USE ZHS16GBK;
-- The following statement may cause an error message. You can ignore alter database national character set internal ZHS16GBK; shutdown immediate; STARTUP; 3. modify the 2nd 3rd bytes of the dmp file to record the character set information. Therefore, you can directly modify the 2nd 3rd bytes of the dmp file to 'foo' the oracle check. In theory, this can be modified only from the subset to the superset, but in many cases it can be modified without the subset and superset relationships. Some of our commonly used character sets, such as US7ASCII, WE8ISO8859P1, ZHS16CGB231280, and ZHS16GBK can be modified. Because only the dmp file is changed, it has little impact. There are many specific modification methods. The simplest is to directly use UltraEdit to modify the 2nd and 3rd bytes of the dmp file. For example, if you want to change the dmp file's character set to ZHS16GBK, you can use the following SQL statement to find the hexadecimal code corresponding to this character set:
SQL> select to_char (nls_charset_id ('zhs16gbk'), 'xxx') from dual; 0354 and then modify the 2 and 3 bytes of the dmp file to 0354. Oracle provides standard functions to convert Character Set names and IDs: SQL> select nls_charset_id ('zhs16gbk') from dual; NLS_CHARSET_ID ('zhs16gbk') www.2cto.com ----------------------- 8521 row selected. SQL> select nls_charset_name (852) from dual; NLS_CHAR--------ZHS16GBK1 row selected. hexadecimal conversion in decimal format: SQL> select to_char ('20140901', 'xxxxx') from dual; TO_CH354 author yujin2010good

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.