Oracle Database Encoding Conversion

Source: Internet
Author: User

Scenario: There is a database encoded as UTF8 on the server, and then the local is ZHS16GBK. I directly with the EXP command to guide down, found that the database is garbled.

Resolution process: Because the code on the server is not easy to change, so consider the local encoding to UTF8, import, and then convert the local encoding to ZHS16GBK.

1, first check the local database code, the statement is

 

2, and then start to modify the local database code: Open cmd, enter Sqlplus, and then enter the username password login.

3, the use of the following code, to change the database code (direct copy paste into the cmd can be directly run), here is the local database to change the International Code UTF8, the state code for the time being not tube.

Conn/as sysdba;
 Shutdown immediate;
 startup Mount;
 ALTER SYSTEM ENABLE restricted session;
 ALTER SYSTEM SET job_queue_processes=0;
 ALTER SYSTEM SET aq_tm_processes=0;
 ALTER DATABASE open;
 ALTER DATABASE character set Internal_use UTF8; 
 Shutdown immediate;
 Startup

4. Export the UTF8 library on the server using EXP and import it into local with Imp.


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.