Use sqlplus in linux to execute SQL scripts for garbled Chinese characters

Source: Internet
Author: User
In linux, SQL Plus is used to execute SQL scripts with Chinese garbled characters to process sqlplus in a group of servers. When SQL scripts are updated regularly, Chinese garbled characters are displayed. At the beginning, I found the wrong problem direction: starting from the source of SQL update script processing, I first made a variety of script files generated by the editor in windows...
In linux, SQL Plus is used to execute SQL scripts with Chinese garbled characters to process sqlplus in a group of servers. When SQL scripts are updated regularly, Chinese garbled characters are displayed. At first, I found the wrong problem direction: starting from the source of SQL update script processing, I first tried to encode the script file generated by the editor in windows, then, debug the encoding and fileencoding in the vi editor. Later I found that it was not a waste of time, but at least I learned a little bit about character encoding. I solve the problem of Chinese garbled characters in SQL plus script execution by using the following methods: 1. the character sets in the production environment are all UTF8, so the scripts uploaded to the server are all saved in 'utf8 without BOM. view Oracle character set encoding: www.2cto.com 1SQL> select userenv ('language') from dual; 2 3 USERENV ('language') 4 %7american_america.al32utf88 9SQL> 3. modify the Linux NLS_LANG environment variable and modify the ". add the following to the base_profile File: 1 export NLS_LANG = "AMERICAN_AMERICA.AL32UTF8" 4. run. bash_pro File to make the environment variable settings take effect. check the value: 1 $ echo $ NLS_LANG2 3AMERICAN_AMERICA.AL32UTF8. now, the Chinese garbled text problem has been solved. We recommend that you refer to the four encoding-related options in Vim. if you are not clear about the relationship between them, visit the following URL to read: www.2cto.com. http://www.2cto.com/os/201208/147952.html Reference Source: http://www.2cto.com/os/201208/147952.html The key of http://www.zfanw.com/blog/vim-encoding-fileencoding-fileencodings.htmlhttp://blog.csdn.net/zzs0829/article/details/7410264 author Wang Zi
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.