Hoje necessitei realizar um expdp de um ambiente Oracle database 11 XE, ao tentar realizar o export, encontrei o erro abaixo:
oracle@phrn008 admin]$ expdp SYSTEM/TESTE@XE directory=DUMP_IPT DUMPFILE=expdp_migracao_01_09_20222.dmp FULL=Y LOGFILE=expdp_migracao_01_09_20222.log consistent=y exclude=statistics
Export: Release 11.2.0.4.0 - Production on Thu Sep 1 13:11:14 2022
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
ORA-39006: internal error
ORA-39213: Metadata processing is not available
ShellScriptSegue a correção:
1 – Tentei fazer a correção seguindo a documentação Oracle Doc ID 402242.1, não deu certo, ocorreu outros erros:
oracle@phrn-008 admin]$ sqlplus / as sysdba
SQL> SQL> execute sys.dbms_metadata_util.load_stylesheets;
BEGIN sys.dbms_metadata_util.load_stylesheets; END;
*
ERROR on line 1:
ORA-31609: error loading the file "kucolumn.xsl" from the directory
file system "/u01/app/oracle/product/11.2.0/xe/rdbms/xml/xsl"
ORA-06512: in "SYS.DBMS_METADATA_UTIL", line 2397
ORA-06512: on line 1
ShellScript2 – Resolução final:
2.1 – Criei o diretório xsl:
oracle@phrn-008 admin]$ cd /u01/app/oracle/product/11.2.0/xe/rdbms/xml
oracle@phrn-008 admin]$ mkdir -p xsl
ShellScript2.2 – Acessei outro servidor com Oracle database 11G e copiei todos os arquivos do diretório xls para o servidor com problema do expdp.
oracle@phrn-010 admin]$ cd /u01/app/oracle/product/11.2.0.4/db_1/rdbms/xml/
oracle@phrn-010 admin]$ scp -p * [email protected]:/u01/app/oracle/product/11.2.0/xe/rdbms/xml/xsl/
ShellScript2.3 – Executei novamente execute dbms_metadata_util.load_stylesheets no servidor com problema do expdp.
SQL> execute dbms_metadata_util.load_stylesheets
PL/SQL procedure completed successfully.
SQL> exit
SQL2.4 – O expdp voltou a funcionar sem erros:
oracle@phrn-008 expdp \'/ as sysdba\' directory=DUMP_IPT DUMPFILE=expdp_migracao_01_09_20222.dmp FULL=Y LOGFILE=expdp_migracao_01_09_20222.log consistent=y exclude=statistics
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
Legacy Mode Active due to the following parameters:
Legacy Mode Parameter: "consistent=TRUE" Location: Command Line, Replaced with: "flashback_time=TO_TIMESTAMP('2022-09-01 13:23:46', 'YYYY-MM-DD HH24:MI:SS')"
Legacy Mode has set reuse_dumpfiles=true parameter.
Starting "SYS"."SYS_EXPORT_FULL_01": "/******** AS SYSDBA" directory=DUMP_IPT DUMPFILE=expdp_migracao_01_09_20222.dmp FULL=Y LOGFILE=expdp_migracao_01_09_20222.log flashback_time=TO_TIMESTAMP('2022-09-01 13: 23:46', 'YYYY-MM-DD HH24:MI:SS') exclude=statistics reuse_dumpfiles=true
Estimation in progress with the BLOCKS method...
Processing the DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA object type
Total estimate using the BLOCKS method: 5,886 GB
ShellScript