[datapump] ORA-39034: Table TABLE_DATA: does not exist.

Keyword:

ORA-39034: Table TABLE_DATA:

does not exist.

問題:

爲了調查問題,在導入用戶提供的ASH Dump時,發生了ORA-39034錯誤,
無法正常導入數據。

  SQL> create user teacherWhat identified by teacherWhat;
    User created.
    SQL> grant dba to teacherWhat;
    Grant succeeded.
    SQL> conn teacherWhat/teacherWhat
    Connected.
    SQL> create or replace directory test_dir as '/temp/temp';
    Directory created.
    SQL> !impdp teacherWhat/teacherWhat directory=test_dir dumpfile=exp_hist_active_sess_history.dmp tables=EXP_HIST_ACTIVE_SESS_HISTORY
    Import: Release 12.1.0.2.0 - Production on Tue Nov 7 02:38:13 2017
    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
    Master table "teacherWhat"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
    import done in UTF8 character set and AL16UTF16 NCHAR character set
    export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    WARNING: possible data loss in character set conversions
    Starting "teacherWhat"."SYS_IMPORT_TABLE_01":  teacherWhat/******** directory=test_dir dumpfile=exp_hist_active_sess_history.dmp tables=EXP_HIST_ACTIVE_SESS_HISTORY
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    ORA-39034: Table TABLE_DATA:"teacherWhat"."EXP_HIST_ACTIVE_SESS_HISTORY" does not exist. ★
    Job "teacherWhat"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at Tue Nov 7 02:38:29 2017 elapsed 0 00:00:07

問題解決:

1.查看在線文檔,看看錯誤的含義。

Home / Database / Oracle Database Online Documentation 12c Release 1 (12.1) / Database Administration
Database Error Messages

https://docs.oracle.com/database/121/ERRMG/ORA-38029.htm#ERRMG-GUID-1B677A70-6415-4030-9B89-9518DBBF2E07

>ORA-39034: Table string does not exist.
>Cause: The user referenced a table in an API that did not exist.
>Action: Correct table name and retry API.

貌似沒有什麼意義,不知如何解決。

嘗試1:
也許是導入用戶的問題,嘗試用system用戶導入,依然無果.

    SQL> !impdp system/oracle directory=test_dir dumpfile=exp_hist_active_sess_history.dmp tables=EXP_HIST_ACTIVE_SESS_HISTORY
    Import: Release 12.1.0.2.0 - Production on Tue Nov 7 02:42:10 2017
    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
    ORA-39002: invalid operation
    ORA-39166: Object SYSTEM.EXP_HIST_ACTIVE_SESS_HISTORY was not found or could not be exported or imported.

看來表就是teacherWhat用戶的,不過表已經存在了。
也許與用戶和表有關係

嘗試2:
刪除用戶,再導入:

   SQL> conn / as sysdba
    Connected.
    SQL> drop user teacherWhat cascade;
    User dropped.
    SQL> !impdp system/oracle directory=test_dir dumpfile=exp_hist_active_sess_history.dmp tables=teacherWhat.EXP_HIST_ACTIVE_SESS_HISTORY
    Import: Release 12.1.0.2.0 - Production on Tue Nov 7 02:52:29 2017
    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
    Master table "SYSTEM"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
    import done in UTF8 character set and AL16UTF16 NCHAR character set
    export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    WARNING: possible data loss in character set conversions
    Starting "SYSTEM"."SYS_IMPORT_TABLE_01":  system/******** directory=test_dir dumpfile=exp_hist_active_sess_history.dmp tables=teacherWhat.EXP_HIST_ACTIVE_SESS_HISTORY
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    ORA-39034: Table TABLE_DATA:"teacherWhat"."EXP_HIST_ACTIVE_SESS_HISTORY" does not exist.
    Job "SYSTEM"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at Tue Nov 7 02:52:38 2017 elapsed 0 00:00:05

依然錯誤。

嘗試3:
建立一個空表,再導入。

    SQL> create user teacherWhat identified by teacherWhat;
    grant dba to teacherWhat;
    conn teacherWhat/teacherWhat
    User created.
    SQL>
    Grant succeeded.
    SQL> SQL>
    Connected.
    SQL>
    SQL>
    SQL> create table teacherWhat.EXP_HIST_ACTIVE_SESS_HISTORY as select * from DBA_HIST_ACTIVE_SESS_HISTORY where 1=0;
    Table created.
    SQL> !impdp teacherWhat/teacherWhat directory=test_dir dumpfile=exp_hist_active_sess_history.dmp tables=teacherWhat.EXP_HIST_ACTIVE_SESS_HISTORY
    Import: Release 12.1.0.2.0 - Production on Tue Nov 7 02:55:44 2017
    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
    Master table "teacherWhat"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
    import done in UTF8 character set and AL16UTF16 NCHAR character set
    export done in AL32UTF8 character set and AL16UTF16 NCHAR character set
    WARNING: possible data loss in character set conversions
    Starting "teacherWhat"."SYS_IMPORT_TABLE_01":  teacherWhat/******** directory=test_dir dumpfile=exp_hist_active_sess_history.dmp tables=teacherWhat.EXP_HIST_ACTIVE_SESS_HISTORY
    Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
    . . imported "teacherWhat"."EXP_HIST_ACTIVE_SESS_HISTORY"    1.659 MB    3611 rows
    Job "teacherWhat"."SYS_IMPORT_TABLE_01" successfully completed at Tue Nov 7 02:55:58 2017 elapsed 0 00:00:11

終於成功了。
猜想原因,也許dump中並沒有該表的定義。也許用戶是通過DATA_ONLY導出的數據。

版權聲明:本文爲博主原創文章,轉載必須註明出處,本人保留一切相關權力!http://blog.csdn.net/lukeunique

歡迎關注微信訂閱號:TeacherWhat
這裏寫圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章