最近,為地市技術人員做技術支援,碰到一個很奇怪的問題,别人給他提供一個exp的dmp檔案,他在本地進行imp的時候報錯:IMP-00037:Character set marker unknown
報錯資訊如下:
C:\Users\localadmin>imp test/oracle file=C:\Users\localadmin\Desktop\jzdjxx.dmp log=C:\Users\localadmin\Deskto
p\jzdjxx.log
Import: Release 11.2.0.1.0 - Production on 星期四 4月 27 11:34:16 2017
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
連接配接到: 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-00037: 未知字元集标記
IMP-00000: 未成功終止導入
C:\Users\localadmin>
經測試,不是expdp導出的dmp檔案,測試資訊如下:
C:\Users\localadmin>impdp test/oracle directory=MYEXPDP dumpfile=jzdjxx.dmp logfile=jzdjxx.log
Import: Release 11.2.0.1.0 - Production on 星期四 4月 27 11:31:58 2017
ORA-39001: 參數值無效
ORA-39000: 轉儲檔案說明錯誤
ORA-31619: 轉儲檔案 "c:\jzdjxx.dmp" 無效
在linux作業系統上,檢視該dmp檔案的字元集,提示資訊如下:
[root@docmaster ~]# cat jzdjxx.dmp |od -x|head -1|awk '{print $2 $3}'|cut -c 3-6
5353
正确的字元集辨別應該是
0354
資料庫中的字元集對照碼驗證:
SQL> select nls_charset_name(to_number('5353','xxxx')) from dual;
NLS_CHARSET_NAME(TO_NUMBER('5353','XXXX'
----------------------------------------
SQL> select nls_charset_name(to_number('0354','xxxx')) from dual;
NLS_CHARSET_NAME(TO_NUMBER('0354','XXXX'
ZHS16GBK
查詢oracle官方metalink,提示exp的dmp檔案損壞: