Translate

2020년 2월 27일 목요일

[Oracle] import 시 테이블 주석(comment)의 한글이 깨지는 경우





증상

 - 오라클에서 imp 명령어로 데이터 import 시 테이블 데이터의 한글은 정상적으로 나오지만 주석만 한글이 ??? 와 같이 깨져서 보여지는 경우
(exp, imp 서버 둘다 캐릭터셋은 동일하게 맞춘상황)

Table, 테이블, 주석, comment, 한글, 깨짐



해결방법
1004lucifer
- 아래와 같이 exp, imp 명령어 수행전 NLS_LANG 을 똑같이 맞춰준다.



[oracle@5cc21db1547a tmp]$ export NLS_LANG=AMERICAN_AMERICA.KO16MSWIN949
[oracle@5cc21db1547a tmp]$
[oracle@5cc21db1547a tmp]$ exp user/password@192.168.0.100/SID file=./data.dmp tables=\(AAAAAAAAAA,BBBBBBBB, ... ,ZZZZZZZZ\)

Export: Release 12.2.0.1.0 - Production on Thu Feb 27 14:37:48 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Export done in KO16MSWIN949 character set and UTF8 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                    AAAAAAAAAAA          1 rows exported
. . exporting table                     BBBBBBBBBB         78 rows exported
                          ...
. . exporting table                     ZZZZZZZZZZ          6 rows exported
Export terminated successfully without warnings.
[oracle@5cc21db1547a tmp]$

...
1004lucifer
[oracle@7b4cc751ef5c setup]$ export NLS_LANG=AMERICAN_AMERICA.KO16MSWIN949
[oracle@7b4cc751ef5c setup]$
[oracle@7b4cc751ef5c setup]$ imp user/password full=y file=/home/oracle/setup/data.dmp

Import: Release 12.2.0.1.0 - Production on Thu Feb 27 15:56:50 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Export file created by EXPORT:V12.02.00 via conventional path
import done in KO16MSWIN949 character set and AL16UTF16 NCHAR character set
export server uses UTF8 NCHAR character set (possible ncharset conversion)
IMP-00403:

Warning: This import generated a separate SQL file "import_sys" which contains DDL that failed due to a privilege issue.

. importing SID's objects into SID
. importing SID's objects into SID
. . importing table                  "AAAAAAAAAAA"          1 rows imported
. . importing table                   "BBBBBBBBBB"         78 rows imported
                             ...
. . importing table                   "ZZZZZZZZZZ"          6 rows imported
Import terminated successfully with warnings.
[oracle@7b4cc751ef5c setup]$ 




PS.
데이터는 문제가 없어서 그냥 둘까 하다가 혹시나 싶어서 위와같이 exp를 다시 수행해서 작업했더니 정상적으로 Table comment 가 보여졌다.



댓글 없음 :

댓글 쓰기