ORA-39006 ORA-39213
今天在进行数据泵导出过程中数据库报错,
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
ORA-39006: internal error
ORA-39213: Metadata processing is not available
此问题之前没碰到过,查询mos发现如下解释:
During dbms_metadata_util.load_stylesheets we read the directory $ORACLE_HOME/rdbms/xml/xsl and load the XSL files using DBMS_LOB package.
If the files cannot be read (most of cases by missing rwx privileges for oracle user), then we raise the errors above.
Re-load the stylesheets using the dbms_metadata_util.load_stylesheets procedure after the permission issue is solved and then retry DataPump import (impdp).
Note: If import fails in PDB, the same has to be run in PDB level.
根据提示检查了相关文件权限,文件权限正常。
然后根据提示执行下面的包
SQL> execute dbms_metadata_util.load_stylesheets;
PL/SQL procedure successfully completed.
执行成功后再次执行expdp,数据能够正常导出。
参考资料:
How To Reload Datapump Utility EXPDP/IMPDP (Doc ID 430221.1)
附录:mos内容
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.2.0.3 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
SYMPTOMS
DataPump import (impdp) reports the errors:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options
ORA-39006: internal error
ORA-39213: Metadata processing is not available
Attempting to correct the error ORA-39213 via dbms_metadata_util.load_stylesheets also reports errors similar to:
SQL> exec dbms_metadata_util.load_stylesheets;
BEGIN dbms_metadata_util.load_stylesheets; END;
*
ERROR at line 1:
ORA-22288: file or LOB operation FILEEXISTs failed
Permission denied
ORA-06512: at "SYS.DBMS_METADATA_UTIL", line 1807
ORA-06512: at line 1
CAUSE
The above errors are almost certainly indicative of permissions issues.
SOLUTION
During dbms_metadata_util.load_stylesheets we read the directory $ORACLE_HOME/rdbms/xml/xsl and load the XSL files using DBMS_LOB package.
If the files cannot be read (most of cases by missing rwx privileges for oracle user), then we raise the errors above.
Re-load the stylesheets using the dbms_metadata_util.load_stylesheets procedure after the permission issue is solved and then retry DataPump import (impdp).
Note: If import fails in PDB, the same has to be run in PDB level.