源端Oracle 12.2
目标端Oracle12.1
由于高版本导出,导入到低版本,因此在导出的时候需要在导出语句中加入version=xxx参数。
expdp a/b@1.1.1.2:9999/hr directory=dp dumpfile=a0301.dmp logfile=expdp_a0301.log schemas=a CLUSTER=N version=12.1
ORA-39373报错是由于version参数导致的,参考MOS文档:12.2 DataPump Export (EXPDP) Using a Lower Export Client Fails Due To ORA-39373 (Doc ID 2369249.1)
In 12.2 Oracle database, the maximum length of identifiers is increased to 128 bytes for most identifiers, up from 30 bytes in previous releases.
Providing longer identifiers gives customers greater flexibility in defining their naming schemes, such as longer and more expressive table names.
Having longer identifiers also enables object name migration between databases with different character sets, such as Thai to Unicode.
12.1.0.2.0版本的数据库所支持的对象名长度为30字符,而在12.2.0.1.0及其以后的数据库已经解决了字符长度(最大长度128)限制的问题,因此导出的时候指定version=12.1,对象名长度超出30个字符,就会出现ORA-39373错误。
解决办法:
To avoid the error, there are two options available:
1/ Start the export using 12.2 expdp client.
- or -
2/ If an old expdp client version must be used or setting Datapump export parameter version to an earlier release to export a 12.2 database, rename the objects with a long identifier to a maximum 30 bytes length (30 characters) and restart the export.
在12CR2版本导入12CR1版本的过程中,由于高版数据库对象名长度限制是128个字符,而低版本对象名长度限制是30个字符,所以要找出高版本库中所有对象名长度超过30的对象,对他们进行删除或者重命名,否则会出现类似“ORA-39373”报错。