Oracle 10g modified character set to UTF8

Source: Internet
Author: User
Tags sqlplus

A character set error was found after installing Oracle, so you need to modify the character set as follows:


System Environment: CentOS 6.5

Oracle Version: 10.2


1. Log in to the system and switch to Oracle user rights

# su-oracle

2. Then enter:
$ sqlplus/as SYSDBA

3. Oracle server-side Character set query
Sql> Select Userenv (' language ') from dual;

USERENV (' LANGUAGE ')----------------------------------------------------American_america. Zhs16gbk

From this we can see that the character set is ZHS16GBK

sql> Exit


4. Querying the character set of Oracle client side
$ echo $NLS _lang
If you find that the data you select is garbled, configure the client's character set to the same character set as the Linux operating system. If it is still garbled, it is possible that there is a problem with the data in the database, or there is a problem with the configuration of the Oracle server.


5. Server-side Character Set modification
To make a character set change by booting the database into restricted mode:
$ sqlplus "/as sysdba"
Sql> Conn/as SYSDBA
sql> shutdown Immediate
Sql> Startup Mount
sql> ALTER SYSTEM ENABLE RESTRICTED SESSION;
sql> ALTER SYSTEM SET job_queue_processes=0;
sql> ALTER SYSTEM SET aq_tm_processes=0;
sql> ALTER DATABASE open;
Sql> ALTER DATABASE character set Internal_use UTF8;
sql> shutdown Immediate
Sql> Startup
Sql> Exit


6. Client Side Character Set modification
Add or modify export nls_lang= American_america in the. Bash_profile in the/home/oracle and/root users directory. UTF8 "statement
$ vi/home/oracle/.bash_profile
#在最后加入如下代码并保存退出
export nls_lang= "American_america. UTF8 "

$ source/home/oracle/.bash_profile



Oracle 10g modified character set to UTF8

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.