Oracle view the character set in the imp exported file

Source: Internet
Author: User

During exp import, we often encounter the issue of inconsistent warning characters. The following describes how to configure the nls_lang parameter during imp/exp import and export.

It is recommended that the configuration of nls_lang be consistent with that of database nls_character when executing exp, so as to avoid character conversion problems and improve exp efficiency. View database nls_character

 
 
  1. SQL> select value from nls_database_parameters where parameter='NLS_CHARACTERSET'; 
  2.  
  3. VALUE 
  4. ------------------------------ 
  5. ZHS16GBK 

Here we only check the character set of the exported exp file.

 
 
  1. $ echo $NLS_LANG 
  2.  
  3. $  
  4. $ exp userid=scott/oracle file='/tmp/scott.dmp' log='/tmp/scott.log' 
  5.  
  6. Export: Release 11.2.0.3.0 - Production on Thu Aug 30 13:07:22 2012 
  7.  
  8. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved. 
  9.  
  10.  
  11. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  12. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  13. Export done in US7ASCII character set and AL16UTF16 NCHAR character set 
  14. server uses ZHS16GBK character set (possible charset conversion) 
  15. . exporting pre-schema procedural objects and actions 
  16. . exporting foreign function library names for user SCOTT  
  17. . exporting PUBLIC type synonyms 
  18. . exporting private type synonyms 
  19. . exporting object type definitions for user SCOTT  
  20. About to export SCOTT's objects ... 
  21. . exporting database links 
  22. . exporting sequence numbers 
  23. . exporting cluster definitions 
  24. . about to export SCOTT's tables via Conventional Path ... 
  25. . . exporting table                          BONUS          0 rows exported 
  26. EXP-00091: Exporting questionable statistics. 
  27. . . exporting table                           DEPT          4 rows exported 
  28. EXP-00091: Exporting questionable statistics. 
  29. EXP-00091: Exporting questionable statistics. 
  30. . . exporting table                            EMP         14 rows exported 
  31. EXP-00091: Exporting questionable statistics. 
  32. EXP-00091: Exporting questionable statistics. 
  33. . . exporting table                       SALGRADE          5 rows exported 
  34. EXP-00091: Exporting questionable statistics. 
  35. . exporting synonyms 
  36. . exporting views 
  37. . exporting stored procedures 
  38. . exporting operators 
  39. . exporting referential integrity constraints 
  40. . exporting triggers 
  41. . exporting indextypes 
  42. . exporting bitmap, functional and extensible indexes 
  43. . exporting posttables actions 
  44. . exporting materialized views 
  45. . exporting snapshot logs 
  46. . exporting job queues 
  47. . exporting refresh groups and children 
  48. . exporting dimensions 
  49. . exporting post-schema procedural objects and actions 
  50. . exporting statistics 
  51. Export terminated successfully with warnings. 

The above prompt shows that the database character set is ZHS16GBK, while the client character set in my client's nls_lang is US7ASCII.

The following shows the character set of the exported/tmp/scott. dmp file.

 
 
  1. $ imp userid=scott/oracle file='/tmp/scott.dmp' show=yes             
  2.  
  3. Import: Release 11.2.0.3.0 - Production on Thu Aug 30 13:07:58 2012 
  4.  
  5. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved. 
  6.  
  7.  
  8. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  9. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  10.  
  11. Export file created by EXPORT:V11.02.00 via conventional path 
  12. import done in US7ASCII character set and AL16UTF16 NCHAR character set 
  13. import server uses ZHS16GBK character set (possible charset conversion) 

Import done in US7ASCII character set and AL16UTF16 NCHAR character set
Import server uses ZHS16GBK character set (possible charset conversion)

In the import done line, the client character set is US7ASCII, and the character set at the import and export end is the same.

The import server line indicates that the character set of the imported database is ZHS16GBK. Because the character set is different, Character Set conversion may occur.

The following prompt appears when the exp client is different from the imp client:

 
 
  1. $ export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK 
  2. $ echo $NLS_LANG 
  3. AMERICAN_AMERICA.ZHS16GBK 
 
 
  1. $ imp userid=scott/oracle file='/tmp/scott.dmp' show=yes 
  2.  
  3. Import: Release 11.2.0.3.0 - Production on Thu Aug 30 13:11:53 2012 
  4.  
  5. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved. 
  6.  
  7.  
  8. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production 
  9. With the Partitioning, OLAP, Data Mining and Real Application Testing options 
  10.  
  11. Export file created by EXPORT:V11.02.00 via conventional path 
  12. import done in ZHS16GBK character set and AL16UTF16 NCHAR character set 
  13. export client uses US7ASCII character set (possible charset conversion) 

Import done in ZHS16GBK character set and AL16UTF16 NCHAR character set
Export client uses US7ASCII character set (possible charset conversion)

The export client line indicates that the character set of the exported client is US7ASCII.

For more details, see the official documentation NLS considerations in Import/Export-Frequently Asked Questions [ID 227332.1].

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.