Expdp of  Table Returns ORA-39166 or ORA-31655 in Oracle Database


Certain system-generated schemas, such as SYS, MDSYS, and ORDSYS, cannot be exported using exp or expdp because they hold Oracle-managed data and metadata. These schemas are essential for the internal functioning of the database and are excluded from export operations.

Additionally, some tables owned by users like SYS or APEX_040200 are automatically skipped during export. These tables are also not eligible for export, even if explicitly specified, as they contain Oracle's internal data.

For example, certain tables owned by SYSTEM user like below cannot be exported:

% expdp system/<PASSWORD> directory=<DIRECTORY_NAME> tables='<TABLE_NAME>'

Export: Release 12.1.0.2.0 - Production on Thu Mar 3 20:39:27 2016

Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_TABLE_01": system/******** directory=<DIRECTORY_NAME> tables='<TABLE_NAME>'
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
ORA-39166: Object SYSTEM.<TABLE_NAME> was not found or could not be exported or imported.
ORA-31655: no data or metadata objects selected for job
Job "SYSTEM"."SYS_EXPORT_TABLE_01" completed with 2 error(s) 

Objects (tables, views, schemas, etc) which fall under either of below conditions are not exported with expdp because they are regarded as system maintained objects.

  • Object is listed in ku_noexp_view.
  • This view is a union of ku_noexp_tab and noexp$ tables.
  • Objects that are listed in this view are not exported.

Object is ORACLE_MAINTAINED='Y' in ALL_OBJECTS (and DBA_OBJECTS).
 

If you wish to export such non-exportable table, create a copy of that table in a user schema, and export that copied table.

eg.
create table <copied_table_name> as select * from <table_you_wish_to_export>;








Please do like and subscribe to my youtube channel: https://www.youtube.com/@foalabs If you like this post please follow,share and comment