【MOS】 EXPDP - ORA-39166 (Object Was Not Found) (文件 ID 1640392.1)
In this Document
Symptoms |
Cause |
Solution |
References |
APPLIES TO:
Oracle Database - Standard Edition - Version 10.1.0.2 to 12.1.0.2 [Release 10.1 to 12.1]Oracle Database - Personal Edition - Version 10.1.0.2 to 12.1.0.2 [Release 10.1 to 12.1]
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 12.1.0.2 [Release 10.1 to 12.1]
Enterprise Manager for Oracle Database - Version 10.1.0.2 to 12.1.0.5.0 [Release 10.1 to 12.1]
Information in this document applies to any platform.
SYMPTOMS
1. You have a user who has created a view, e.g.:
create user tc identified by tc default tablespace users
temporary tablespace temp quota unlimited on users;
grant create session, create table, create view to tc;
create directory my_dir as '/tmp/expdp';
grant read, write on directory my_dir to system;
connect tc/tc
create table tc.my_tab1 (nr number, txt varchar2(10));
insert into tc.my_tab1 values (1,'Line 1');
insert into tc.my_tab1 values (2,'Line 2');
create table tc.my_tab2 (nr number, col2 number, col3 varchar2(10));
insert into tc.my_tab2 values (1,1,'c3_1');
insert into tc.my_tab2 values (2,2,'c3_2');
commit;
create view my_view (nr, txt, col3) as
select t1.nr, t1.txt, t2.col3
from tc.my_tab1 t1, tc.my_tab2 t2
where t1.nr=t2.nr;
select * from my_view;
NR TXT COL3
------------ ---------- ----------
1 Line 1 c3_1
2 Line 2 c3_2
2. When you export the view with DataPump, then only the DDL of the view is exported, e.g.:
Export: Release 11.2.0.4.0 - Production on Thu Mar 27 09:43:13 2014
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 "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** DIRECTORY=my_dir DUMPFILE=expdp_vw.dmp LOGFILE=expdp_vw.log SCHEMAS=tc INCLUDE=view:"='MY_VIEW'"
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is:
/tmp/expdp/EXPDP_VW.DMP
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at Thu Mar 27 09:43:24 2014 elapsed 0 00:00:10
3. When you try to export the data that is represented by the view by specifying the TABLES parameter, the following errors are reported:
Export: Release 11.2.0.4.0 - Production on Thu Mar 27 09:47:34 2014
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 "SYSTEM"."SYS_EXPORT_TABLE_01": system/******** DIRECTORY=my_dir DUMPFILE=expdp_vw.dmp LOGFILE=expdp_vw.log TABLES=tc.my_view
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
ORA-39166: Object TC.MY_VIEW was not found.
ORA-31655: no data or metadata objects selected for job
Job "SYSTEM"."SYS_EXPORT_TABLE_01" completed with 2 error(s) at Thu Mar 27 09:47:38 2014 elapsed 0 00:00:03
CAUSE
The Export Data Pump parameter TABLES cannot be used to export the data that is represented with a VIEW.
SOLUTION
1. Upgrade to Oracle12c where you can specify the Export Data Pump parameter VIEWS_AS_TABLES (to export a table with the same columns as the view and with row data fetched from the view. Data Pump also exports objects dependent on the view, such as grants and constraints).
Note that this is a new feature in 12c which does not exist in 11g. Example:
Export: Release 12.1.0.1.0 - Production on Thu Mar 27 08:38:07 2014
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_TABLE_01": system/******** DIRECTORY=my_dir DUMPFILE=expdp_vw.dmp LOGFILE=expdp_vw.log VIEWS_AS_TABLES=tc.my_view
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE_DATA
Total estimation using BLOCKS method: 16 KB
Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE
. . exported "TC"."MY_VIEW" 5.906 KB 2 rows
Master table "SYSTEM"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
/tmp/expdp/expdp_vw.dmp
Job "SYSTEM"."SYS_EXPORT_TABLE_01" successfully completed at Thu Mar 27 08:38:29 2014 elapsed 0 00:00:17
-- or --
2. Create a fixed table in the source database which contains the rows that you want to export (the rows from the view), e.g.
and export the data from the temporary fixed table, e.g.:
-- or --
3. Export all source tables (all rows) and all other related objects, e.g.:
REFERENCES
NOTE:341733.1 - Export/Import DataPump Parameters INCLUDE and EXCLUDE - How to Load and Unload Specific ObjectsAbout Me
...............................................................................................................................
● 本文來自於MOS轉載文章(文件 ID 1640392.1)
● 小麥苗雲盤地址:http://blog.itpub.net/26736162/viewspace-1624453/
● QQ群:230161599 微信群:私聊
● 聯絡我請加QQ好友(642808185),註明新增緣由
● 版權所有,歡迎分享本文,轉載請保留出處
...............................................................................................................................
手機長按下圖識別二維碼或微信客戶端掃描下邊的二維碼來關注小麥苗的微信公眾號:xiaomaimiaolhr,免費學習最實用的資料庫技術。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2130834/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【MOS】Creating a PDB ... Fails With ORA-17630 (文件 ID 2090019.1)AI
- -bash: id: command not found -bash: tty: command not found
- expdp/impdp變慢 (Doc ID 2469587.1)
- 【MOS】從 11.2.0.N 版本非原地手動升級到最新的 11.2.0.N (文件 ID 1602485.1)
- Plugin with id 'com.android.application' not found.PluginAndroidAPP
- bash: ssh-copy-id: command not found...
- 【MOS】手動升級到資料庫 12c 版本1(12.1)的完整核對清單 (文件 ID 2047701.1)資料庫
- DOM (文件物件模型(Document Object Model))物件模型Object
- 【MOS】如何利用RMAN可傳輸表空間遷移資料庫到不同位元組序的平臺(文件 ID 1983639.1)資料庫
- [20191204]oracle能建立最大object_id是多少.txtOracleObject
- ORA-8103 Troubleshooting, Diagnostic and Solution (文件 ID 8103.1)
- native mos
- [20191206]為什麼oracle能建立最大object_id=4254950910.txtOracleObject
- mos初階
- Library Cache 診斷:Lock, Pin 以及 Load Lock (文件 ID 1548524.1)
- expdp query用法
- MOS管隨筆
- RMAN restore fails with ORA-01180: can not create datafile 1 (文件 ID 1265151.1)RESTAI
- Oracle MOS:CSI 申請Oracle
- Oracle OCP(32):SUPPORT:MOSOracle
- expdp一個例子
- Oracle 18c - 配置只讀 OracleHome / DBCA / Patching / Upgrade (文件 ID 2469646.1)Oracle
- crsd.bin Fail With Error CRS-1019 When ohasd Restarted (文件 ID 2291799.1)AIErrorREST
- MOS管開關電路
- Android Studio專案匯入之後出錯:Error:(1, 0) Plugin with id 'com.android.application' not found.AndroidErrorPluginAPP
- KVO後[obj class]與object_getClass(id obj)的結果竟會不一致?Object
- kubeadm not found
- 如何確定Single-Primary模式下的MGR主節點(文件 ID 2214438.1)模式
- ES7 Object.keys,Object.values,Object.entriesObject
- My Oracle Support, 縮寫為MOSOracle
- ObjectObject
- 批量按使用者expdp
- expdp+compression效能測試
- 正常終止expdp作業
- expdp報錯ORA-39181
- 介面返回[object,Object]解決方法Object
- nodemon: command not found
- pip: command not found
- found an invalid color