본문 바로가기
정보관리(데이터베이스, DB)/오라클

IMP-00038: Could not convert to environment character set's handle

by 3604 2023. 11. 27.
728x90

출처: https://qiita.com/ponsuke0531/items/aabb66dee21e2eb8a61b

IMP-00038: Could not convert to environment character set's handleとなった時の対応方法

Last updated at 2020-04-21Posted at 2020-04-21
  • 環境
    • Red Hat Enterprise Linux Server release 5.11 (Tikanga)
    • SQL*Plus: Release 11.2.0.1.0
    • Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

impコマンドでDumpをインポートしようとしたら怒られた

$ imp ponsuke/password file=/path/to/dpdump/hogedb.dmp fromuser=hogedb touser=testhoge

Import: Release 11.2.0.1.0 - Production on Tue Apr 21 14:04:57 2020

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


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

IMP-00038: Could not convert to environment character set's handle
IMP-00000: Import terminated unsuccessfully

原因 : expdpコマンドでエクスポートしたDumpファイルをimpコマンドでインポートするから

参考 : ORACLE 11g IMP-00038 キャラクタセットが同じ場合の原因 解決方法:ITみたいな なにか!?

expdpコマンドでエクスポートしたファイルだった・・・

対応 : impdpコマンドでインポートする

ORACLE/IMPORT(impdp)編 - オラクルちょこっとリファレンス

うまくいった
$ impdp ponsuke/password directory=DATA_PUMP_DIR dumpfile=hogedb.dmp remap_schema=hogedb:testhogedb

Import: Release 11.2.0.1.0 - Production on Tue Apr 21 14:33:09 2020

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Legacy Mode Active due to the following parameters:
...省略...

ほかの原因 : エクスポートしたDBとインポートしたDBのキャラクタセットが違うから

でキャラクタセットを確認する方法
SQL> select * from nls_database_parameters where parameter in ('NLS_LANGUAGE','NLS_CHARACTERSET');

PARAMETER                      VALUE
------------------------------ --------------------------------------------------------------------------------
NLS_LANGUAGE                   AHOGEICAN
NLS_CHARACTERSET               JA16SJISTILDE

728x90