Oracle IMP Character Set problem resolution ____oracle

Source: Internet
Author: User
Tags set set
Problem:
When IMP is a DMP file, the prompts do not support the required character set conversion (from type 850 to 852).
principle:
Oracle Multi-Language settings are designed to support the world wide range of languages and character sets, and are generally effective for language hints, currency forms, sorting methods, and the display of data in char,varchar2,clob,long fields. The main two features of Oracle's multinational language settings are national language settings and character set settings, and national language settings determine the type of language that the interface or hint uses, and the character set determines the encoding rules for the database to hold data about the character set (such as text).
Oracle Character set set, divided into database character set and client character set environment settings. At the database end, the character set is set when the database is created and stored in the Database props$ table, and for products above 8i, the Alter database character set can already be used. Character set ' to modify the character set of the database, but only from a subset to a superset, do not modify the character set through the update props$, if it is an unsupported conversion, you may lose all data related to the character set, that is, a supported transformation, or it may cause the database to work abnormally. The character set is divided into Single-byte character sets and multibyte character sets, and Us7ascii is a typical single-byte character set, which is LENGTH=LENGTHB in this character set, and ZHS16GBK is the commonly used double-byte character set, Lengthb=2*length here.
In the client's character set environment is relatively simple, mainly environmental variables or registry key Nls_lang, note that Nls_lang priority is: parameter file à registry à environment variable àalter session. The Nls_lang is composed of "national language settings. Character sets", such as Nls_lang=simplified CHINESE_CHINA.ZHS16GBK. The client's character set is best the same as the database side (the national language settings can be different, such as the ZHS16GBK character set, the client can be Nls_lang =simplified CHINESE_CHINA.ZHS16GBK or Ameircan_ AMERICA.ZHS16GBK, does not affect the normal display of database characters), if the character set is not the same, and the conversion of the character set is not compatible, then the client's data display and export/import of the character set-related data will be garbled.

programme:
Use the 2-in-file editing tool, such as Uedit32. Open the exported DMP file, get 2, 3 bytes of content, such as 00 01, first convert it to 10, 1, use the function nls_charset_name to get the character set:
Sql> Select Nls_charset_name (1) from dual;
Nls_charset_name (1)
-------------------
Us7ascii
You can know that the character set of the DMP file is Us7ascii, and if you need to replace the character set of the DMP file with ZHS16GBK, you need to obtain the number of the character set with nls_charset_id:
Sql> Select nls_charset_id (' ZHS16GBK ') from dual;
nls_charset_id (' ZHS16GBK ')
--------------------------
852
Convert 852 to 16, 354, 2, 3 bytes 00 01 to 03 54, complete the conversion of the DMP file character set from Us7ascii to ZHS16GBK, and then import the DMP file into the ZHS16GBK character set database.

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.