Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze exp/imp through ZHS16GBK and AL32UTF8 character Encoding

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to analyze exp/imp through ZHS16GBK and AL32UTF8 character coding? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Experimental environment: vmware server + rhel5.4 (English operating system) + oracle10g

Problem description: the default character set of Oracle installed by colleagues under Linux is not modified. It uses WE8ISO8859P1 and cannot support Chinese.

The problem is that the Chinese data entered by the client can be displayed, and after it is submitted and queried, it will be displayed in Chinese. The problem lies in the fact that the character set of the oracle server does not support Chinese.

You can do this by:

The select userenv ('language') from dual; command can view the character set used by the server.

Or select * from versions NLSprograms parametres; the command can also be

And select * from SYS.PROPS$

After confirming the problem, I Google for a while, but there are a lot of information about this on the Internet. May be their own environment and their inconsistent reasons, according to those online steps I did not solve the problem.

If the root cause of the problem is found, it is easy to solve it. Referring to the information on the Internet, your own steps to solve the problem are as follows:

Generally speaking, there are two ideas:

1. Reinstall

2. Modify the character set

Note: the first method is useless. I think reloading is not my favorite way, and solving the problem is fundamental. So I chose the second way.

Many people on the Internet say that the character set cannot be changed after the oracle server is installed, and practice has proved that it can be modified, at least the versions above oracle8 can be modified.

My solution steps:

1. Log in to ssh and switch to oracle user.

Switch user command: su-oracle

Then log in to oracle with sqlplus, and command:

: sqlplus / nolog

: connect / as sysdba

So log in.

2. Change the character set

First, after sqlplus login, close the oracle database

1.shutdown immediate

2.startup mount

3.alter system enable restricted session

4.alter system set JOB_QUEUE_PROCESSES=0

5.alter system set AQ_TM_PROCESSES=0

6.alter database open

7. Alter database character set INTERNAL_USE ZHS16GBK

8.shutdown immediate

9.startup

Note: at first I did not solve the problem in accordance with the above steps, because in step 7, some data indicated that I had tried to use alter database character set ZHS16GBK;, but this command did not work. I used the alter database character set INTERNAL_USE ZHS16GBK; prompt to modify successfully. Similarly, if you prompt error under startup mount, you can try running the command in step 7 under startup restrict.

The following is my debugging command record, you can refer to, those commands that prompt errors are failed, can be ignored.

SQL > conn / as sysdba

Connected.

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL > startup mount

ORACLE instance started.

Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 104859216 bytes

Database Buffers 176160768 bytes

Redo Buffers 2973696 bytes

Database mounted.

SQL > alter system enable restricted session

System altered.

SQL > alter system set job_queue_processes=0

System altered.

SQL > alter system set aq_tm_processes=0

System altered.

SQL > alter database open

Database altered.

-this is done according to the steps on the Internet, but all the commands fail, so these commands are not good for my environment.

SQL > alter database character set ZHS16GBK

Alter database character set ZHS16GBK

*

ERROR at line 1:

ORA-12712: new character set must be a superset of old character set

-I also tried to switch to other character sets, but it didn't work either. I also reported an error.

SQL > alter database character set AL32UTF8

Alter database character set AL32UTF8

*

ERROR at line 1:

ORA-12712: new character set must be a superset of old character set

-at this point, the online step debugging failed, so I continued to check the information and debugged as follows

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL > startup restrict

ORACLE instance started.

Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 113247824 bytes

Database Buffers 167772160 bytes

Redo Buffers 2973696 bytes

Database mounted.

Database opened.

-at first I used the following command, but failed

SQL > alter database character set simplified chinese_china.zhs16gbk

Alter database character set simplified chinese_china.zhs16gbk

*

ERROR at line 1:

ORA-00933: SQL command not properly ended

I tried it twice, but I couldn't change it to uppercase.

SQL > alter database character set simplified CHINESE_CHINA.ZHS16GBK

Alter database character set simplified CHINESE_CHINA.ZHS16GBK

*

ERROR at line 1:

ORA-00933: SQL command not properly ended

Finally, I used this command to indicate that the execution was successful, and then solved the Chinese garbled problem by testing

SQL > alter database character set INTERNAL_USE ZHS16GBK

Database altered.

SQL > shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL > startup

ORACLE instance started.

Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 113247824 bytes

Database Buffers 167772160 bytes

Redo Buffers 2973696 bytes

Database mounted.

Database opened.

SQL >

This is the answer to the question about how to analyze exp/imp through ZHS16GBK and AL32UTF8 character coding. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report