Thursday, January 10, 2019

ORA-06502: character string buffer too small when performing Data Datapump Utility EXPDP

Symptoms:

When performing the Datapump Export or Import it gets an error that might be internal errors, data dictionary incompatibility, or anything else still unkown.
The message might be such as this piece of code:

Processing object type DATABASE_EXPORT/SCHEMA/JAVA_SOURCE/JAVA_SOURCE
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.GATHER_PARSE_ITEMS [JAVA_SOURCE:"<SCHEMA_NAME>"."runtime/PingResponse_LiteralSerializer"]
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 11259


Cause: 

This error could be caused by several reasons including a bug on the Datapump data dictionary depending on the version of database you are working on.



Solution:

The solution is given on Oracle Support Document (Doc ID 430221.1), says:
In some cases DataPump utility may get corrupted and we need to recreate DataPump utility to overcome internal corruption.



  • For Oracle version 10.1 :


-- 1. Catdp.sql orders the installation of all its components including the Metadata API which was previously installed separately. By default catproc.sql invoke this script. 
SQL> @$ORACLE_HOME/rdbms/admin/catdp.sql 

-- 2. dbmspump.sql will create DBMS procedures for dataPUMP 
SQL> @$ORACLE_HOME/rdbms/admin/dbmspump.sql




  • For Oracle version 10.2:


-- 1.Catdph.sql will Re-Install DataPump types and views 
SQL> @$ORACLE_HOME/rdbms/admin/catdph.sql 

-- Note:
-- If XDB is installed, then it is required to run "catmetx.sql" script also. 
-- Use this code to verify if XDB is installed: 

SQL> select substr(comp_name,1,30) comp_name, 
     substr(comp_id,1,10) comp_id,
     substr(version,1,12) version,
     status 
     from dba_registry; 

-- Sample output if XDB installed, 
Oracle XML Database    XDB    -version-    VALID 

-- 2.prvtdtde.plb will re-install tde_library packages 
SQL> @$ORACLE_HOME/rdbms/admin/prvtdtde.plb 

-- 3. Catdpb.sql will Re-Install DataPump packages 
SQL> @$ORACLE_HOME/rdbms/admin/catdpb.sql 

-- 4.Dbmspump.sql will Re-Install DBMS DataPump objects 
SQL> @$ORACLE_HOME/rdbms/admin/dbmspump.sql 

-- 5. To recompile  invalid objects, if any 
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql




  • For Oracle version 11g and higher prior to 12c:


-- 1.Catproc.sql
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql

-- 2.To recompile invalid objects, if any
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql




  • For Oracle version 12c:


Note 1: Prior rebuilding DP catalog in 12.1.0.2 CDB , install Patch 25139545 as alerted in Document 2175021.1 - "Alert - Multitenant Customers: The objects created by the post-install steps of 12.1.0.2 Generic DataPump Patches Are not Shared Across All PDBS".
Note 2:  For issues regarding KU$ Invalid Objects Owned by SYS after upgrading or applying datapatch, refer to Document 2289785.1 to rebuild Datapump.


Rebuild the DataPump packages with the following steps.
Under the ORACLE_HOME, execute:
cd rdbms/admin

-- run the dpload.sql in the CDB with all of the PDBs open

From a SQL*Plus session, connect as sysdba and then run dpload.sql:

@dpload.sql

on the affected database. 

Note: If DataPump catalog is not valid in a PDB, same step should be executed to validate the DP catalog on a pluggable database.



Source: Oracle Support - How To Reload Datapump Utility EXPDP/IMPDP (Doc ID 430221.1)

No comments:

Post a Comment

Configure the Oracle DB Access Control List to avoid error like ORA-24247: network access denied

Symptoms:  You try to make external connections from the Oracle Database and receive erros like ORA-24247: network access denied by access c...