Tips for character set conversion in Oracle databases

Source: Internet
Author: User

We all know that in a large database management system, Oracle databases play an obvious role in both database management capabilities and security. Chinese enterprises also use many Oracle databases, but the character sets of different Oracle versions bring a lot of trouble to data display, data backup, data conversion, and other practical work.

1. character set parameters

Once a database is created, its character set cannot be changed. Therefore, it is very important to consider which character set to use. The Oracle database character set should be a superset of the local character set of the operating system. The character set used by the customers who access the database determines which superset to choose, that is, the database character set should be the superset of all customer character sets.

The following describes some NLS_LANG parameters related to character sets:

NLS_LANG format:

 
 
  1. NLS_LANG=language_territory.charset  

Has three components: language, region, and character set. Each component controls the NLS subset. Three components can be combined at any time, for example:

 
 
  1. AMERICAN_AMERICA.US7SCII   
  2. JPANESE_JAPAN.JA16EUC  

Language indicates the language of the server message.

Territory specifies the date and number format of the server.

Charset

You can also define the NLS_LANG parameter in some subsets:

The default date format of NLS_DATE_FORMAT

Default date language of NLS_DATE_LANGUAGE

The NLS_NUMBERIC_CHARACTERS decimal character is separated from the component

NLS_CURRENCY local currency character

NLS_ISO_CURRENCY ISO currency character

NLS_SORT character sorting Sequence

Ii. Character Set Conversion

1. How to modify the NLS_LANG parameter:

1) log on to Oracle with the SYS user name.

2) view character set content

 
 
  1. SQL>SELECT * FROM PROPS$;  

3) modify the corresponding character subset

 
 
  1. SQL>UPDATE PROPS$ SET VALUE$=’SIMPLIFIED CHINESE ‘   
  2. WHERE NAME=’NLS_LANGUAGE’;  

4) Submit the ticket;

2. Specific applications of the NLS_LANG parameter:

1) The server/client mode is used. The character sets at both ends are different.

Modify the client character set:

WIN95/WIN98: Modify the Registry

 
 
  1. HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\NLS_LANG  

UNIX: Follow the 1 method to directly go to Oracle for modification.

2) use EXP/IMP commands for different character sets

Follow the 1 method to modify the character set settings of IMP. If it is a WIN98/WIN95 system, you must also modify the registry. Note: The parameters of the three subsets of NLS_LANG must be consistent. In addition, if the single-and double-byte character sets are different, you cannot modify the character set for conversion. You can use other methods to perform Oracle database migration without modifying the character set. For example, if the data volume is small, you can use the SQLLOAD command to convert text files and use other Oracle database software ACCESS and FOXPRO) conversion.

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.