oracle11g Character Set Al32utf8 modified to ZHS16GBK detailed

Source: Internet
Author: User
Tags sqlplus hp server

This issue occurs during the database migration process. SOURCE database: Win7 64-bit System oracle11g Personal Edition, character set ZHS16GBK, target database, HP sqlserver2008 system 64-bit database server, character set Al32utf8 on your notebook.

This afternoon when deploying a database server in HP, the ORACLE11G Enterprise Edition default character set is Al32utf8,

And my local computer installed the ORACLE11G personal database character set server side by default is ZHS16GBK, so when I import my native exported database. dmp files to the HP database, the report

IMP Error and error description information is garbled in Chinese. And then through my Internet access information that if you want to solve the garbled problem must meet the following conditions:

The character set format must be the same for the server and client character sets of the target database and for the DMP files to import the source database from me locally. While my local source database character set is ZHS16GBK, the target server-side character set is Al32utf8 and obviously does not meet the above conditions.

Then I first try to change the HP server database characters in the following way:

Try method One: Execute the following statement under Sys/sys: (failed)

Note:sql> ALTER DATABASE CHARACTER SET ZHS16GBK;
ALTER DATABASE CHARACTER SET ZHS16GBK

The results report the following error:
ERROR on line 1th:
ORA-12712: The new character set must be a superset of the old character set.

Note: Superset Explanation: If the S1 collection contains every element in the S2 collection, and the S1 collection may contain elements that are not contained in the S2 collection, then S1 is called the S2 super. Description Al32utf8 contains ZHS16GBK.

Try method Two: Use Scott/tiger login sqlplus then connect Sys/sys as SYSDBA, and then enter the command, the text is red, please use their own password set. (This method is successful after testing!) )

Then execute the following SQL statements sequentially in the Sqlplus interface:

If the database server is now started, execute the shutdown immediate command to shut down the database server, and then execute the following command: NOTE: Each SQL statement will have a corresponding prompt, please enter it carefully.

Sql>STARTUP MOUNT; SQL>ALTERSYSTEM ENABLE RESTRICTED SESSION; SQL>ALTERSYSTEMSETJob_queue_processes=0; SQL>ALTERSYSTEMSETAq_tm_processes=0SQL>ALTER DATABASE OPEN; SQL>ALTER DATABASE CHARACTER SETInternal_use ZHS16GBK;//skipping hyper-subset detection SQL>ALTER DATABASE  National CHARACTER SETINTERNAL ZHS16GBK;

This line does not work, error after execution Ora-00933:sql command did not end correctly, but the execution of the previous line of command has been in effect, other articles do not mention the bank.

SQL>SHUTDOWN  IMMEDIATE; SQL>STARTUP

Finally restart oracle11g monitoring and service, re-login PL/SQL developer,

Execute select userenv (' language ') Nls_lang from dual; The target database was found to have the following character set, which has been correctly modified to simplified. Chinese_china. ZHS16GBK.

Nls_lang

----------------------------------------------------
Simplified Chinese_china. Zhs16gbk

Then execute the corresponding imp ldpssts/[email protected] FROMUSER=LSPSS touser=ldpssts file=d:\imp\ldpssts.dmp Log=d:\imp\ldpssts.log, Import execution succeeded.

oracle11g Character Set Al32utf8 modified to ZHS16GBK detailed

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.