Solve the problem of Chinese garbled characters in Sqlplus foreground program

Source: Internet
Author: User
Tags sqlplus

In the process of using sqlplus, it is common to encounter the problem that a machine is garbled in Chinese when accessing the Oracle database, which is caused by inconsistency between the client character set and the server character set. In real-world use, the server character set, the client character set and the operating system character set must be consistent, or to include a relationship in order to correctly display Chinese characters, this experience describes a way to eliminate garbled characters by modifying the client character set and the operating system character set.

  1. Press Win+r to bring up the Windows Runtime window and enter "cmd" in the window to enter the command-line program.

  2. On the cmd command line, enter "Sqlplus username/password @ service name" to log into the database, where the user name, password, service name needs to be replaced according to the actual situation. After landing, you will find that the prompt is not noon, or contain garbled, this is the problem we need to solve. Execute select userenv (' language ') from dual in Sqlplus and view the character set of the current database as: Simplified Chinese_china. ZHS16GBK. All we need to do is set the client and operating system character sets to this.

  3. First set the client character set, right click on My Computer, select Properties.

  4. In the Properties dialog box that pops up, select Advanced, environment variables.

  5. Look for an environment variable named "Nls_lang" in the environment variable, and if not, create a new one and assign the value of the variable to: "Simplified Chinese_china. ZHS16GBK "(needs to be assigned based on the actual database server character set). The client character set setting was successful.

  6. From the Start menu, select Control Panel-Regional and Language options to set the computer language under this option.

  7. Under Advanced options, select the language for non-Unicode programs in Chinese, and click OK. When you click OK, you will be prompted to install the character set and prompt you need to restart your computer to take effect, restart.

  8. Restart completed, again into the sqlplus, found Chinese garbled problem solved.

    Note: Add new data again to see that it is not garbled article from: http://jingyan.baidu.com/article/48b558e33242ad7f38c09af8.html

Solve the problem of Chinese garbled characters in Sqlplus foreground program

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.