Datapump Export Fails With ORA-39126 And ORA-65040 In Multitenant Database at TABLE_STATISTICS (Doc ID 2245663.1)

Last updated on APRIL 11, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 to 12.1.0.2 [Release 12.1]
Information in this document applies to any platform.

Symptoms

- DataPump export invoked from a PDB, fails with the below errors when unloading TABLE_STATISTICS :

...
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.STATS_UNLOAD [TABLE_STATISTICS]
MARKER
ORA-65040: operation not allowed from within a pluggable database

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.KUPW$WORKER", line 11265
...

- DataPump export completes without any error if parameter "EXCLUDE=STATISTICS" is used.

- Tracing DataPump job for ORA-65040, the generated trace file shows the following failing statement:

=======================================================
dbkedDefDump(): Starting a non-incident diagnostic dump (flags=0x0, level=3, mask=0x0)
----- Error Stack Dump -----
ORA-65040: operation not allowed from within a pluggable database
----- Current SQL Statement for this session (sql_id=41x6bchaxckzg) -----
drop type "SYS".SYS_PLSQL_15AD49DF_1971_1 force
========================================================

 

Changes

In this case, "SYS".SYS_PLSQL_15AD49DF_1971_1 is a metadata link in the pluggable database:

OWNER OBJECT_NAME OBJECT_TYPE SHARING ORACLE_MAINTAINED
---------------------------------------------------------------------------
SYS SYS_PLSQL_15AD49DF_1971_1 TYPE METADATA LINK Y

SQL> select dbid,name,cdb,open_mode,con_id from v$database;

DBID NAME CDB OPEN_MODE CON_ID
---------- --------- --- -------------------- ----------
1811567179 CMSAD YES READ WRITE 0

SQL> select pdb_id, pdb_name, status from dba_pdbs order by 1;

PDB_ID PDB_NAME STATUS
----------------------------------------------------------------------------------------------------
2 PDB$SEED NORMAL
3 MSAD NORMAL

SQL> select con_id, OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS, to_char(CREATED, 'DD-MON-YYYY hh24:mm') from cdb_objects where object_name='SYS_PLSQL_15AD49DF_1971_1';

CON_ID OWNER OBJECT_NAME OBJECT_TYPE STATUS TO_CHAR(CREATED,'
----------------------------------------------------------------------------------------------------
3 SYS SYS_PLSQL_15AD49DF_1971_1 TYPE VALID 31-MAR-2016 23:03

SQL> select obj#, owner#, name, type#, status from obj$ where name like 'SYS_PLSQL_15AD49DF_1971_1';

no rows selected

SQL> alter session set container=MSAD;

Session altered.

SQL> select obj#, owner#, name, type#, status from obj$ where name like 'SYS_PLSQL_15AD49DF_1971_1';

OBJ# OWNER# NAME TYPE# STATUS
----------------------------------------------------------------------------------------------------
11381 0 SYS_PLSQL_15AD49DF_1971_1 13 1

Using the above sql statements, it was found that the TYPE object (SYS_PLSQL_15AD49DF_1971_1) does not exist in CDB$ROOT, but its associated metadata link exists in the pluggable database MSAD.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms