暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

expdp导sys用户表时报错ORA-39166、ORA-31655

原创 Leo 2022-11-08
2311

问题描述:expdpsys用户表时报错ORA-39166ORA-31655,如下所示:

[oracle@oel ~]$ expdp \'/ as sysdba\' directory=DATA_PUMP_DIR dumpfile=test.dmp logfile=expdp.log tables=test

 

Export: Release 11.2.0.4.0 - Production on Tue Nov 8 17:08:00 2022

 

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

 

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Starting "SYS"."SYS_EXPORT_TABLE_01":  "/******** AS SYSDBA" directory=DATA_PUMP_DIR dumpfile=test.dmp logfile=expdp.log tables=test

Estimate in progress using BLOCKS method...

Total estimation using BLOCKS method: 0 KB

ORA-39166: Object SYS.TEST was not found.

ORA-31655: no data or metadata objects selected for job

Job "SYS"."SYS_EXPORT_TABLE_01" completed with 2 error(s) at Tue Nov 8 17:08:02 2022 elapsed 0 00:00:01

TEST表信息.

SQL> show user

USER is "SYS"

SQL> select count(*) from test;

 

  COUNT(*)

----------

      2000

异常原因:根据MOS (Doc ID 553402.1)文档,单独导出sys用户表会报此异常,当使用full模式导出,不会报此错误.

以下MOS信息:

SYMPTOMS

DataPump export of table SYS.AUD$ fails with errors:

ORA-39165: Schema SYS was not found.
ORA-39166: Object AUD$ was not found.
ORA-31655: no data or metadata objects selected for job
Job "SYS"."SYS_EXPORT_TABLE_01" completed with 3 error(s) at 13:49:47

CAUSE

There is a restriction on DataPump export. It cannot export schemas like SYS, ORDSYS, EXFSYS, MDSYS, DMSYS, CTXSYS, ORDPLUGINS, LBACSYS, XDB, SI_INFORMTN_SCHEMA, DIP, DBSNMP and WMSYS in any mode. The Utilities Guide indicates the restriction only on full export mode, but the restriction actually applies to all modes.

SOLUTION

采用exp导出方式.

[oracle@oel ~]$ exp \'/ as sysdba\' file=/home/oracle/test.dmp log=/home/oracle/exp.log tables=test

 

Export: Release 11.2.0.4.0 - Production on Tue Nov 8 17:35:05 2022

 

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

 

 

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set

 

About to export specified tables via Conventional Path ...

. . exporting table                           TEST       2000 rows exported

Export terminated successfully without warnings.

说明:成功导出test表,导出前注意数据库字符集与系统环境变量NLS_LANG需保持一致.

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论