【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】EXPDP Fails ORA-39165: Schema SYS Was Not Found (文件 ID 553402.1)AI
- 【MOS】Why an Object Not Be Exported? ORA-39166 or ORA-31655 (文件 ID 2114233.1)ObjectExport
- 【MOS】Top Ten Performance Mistakes Found in Oracle Systems. (文件 ID 858539.1)ORMOracle
- 【MOS】Top 5 Grid Infrastructure Startup Issues (文件 ID 1368382.1)ASTStruct
- 【MOS】Parameter FILESIZE - Multiple Export Files (文件 ID 290810.1)Export
- 【MOS】Limitations of the Oracle Cost Based Optimizer (文件 ID 212809.1)MITOracle
- 【MOS】Index Rebuild Is Hanging Or Taking Too Long (文件 ID 272762.1)IndexRebuild
- 【MOS】Cluster Health Monitor (CHM) FAQ (文件 ID 1328466.1 ID 2062234.1)
- 【MOS】Troubleshooting 'enq: TX - index contention' Waits (文件 ID 873243.1)ENQIndexAI
- EXP Or EXPDP時hang住問題,MOS解決方案
- Top Ten Performance Mistakes Found in Oracle Systems. (文件 ID 858539.1)ORMOracle
- 【MOS】12c RAC "enq: IV - contention" (文件 ID 2028503.1)ENQ
- OBJECT_ID和DATA_OBJECT_IDObject
- 【MOS】Redundant Interconnect ora.cluster_interconnect.haip (文件 ID 1210883.1)AI
- Differences between DATA_OBJECT_ID and OBJECT_IDObject
- object_id 及 data_object_id (oracle)ObjectOracle
- DOM (文件物件模型(Document Object Model))物件模型Object
- 【MOS】Creating a PDB ... Fails With ORA-17630 (文件 ID 2090019.1)AI
- object_id and data_object_id in dba_objectsObject
- 【MOS】OCR/Vote disk 維護操作: (新增/刪除/替換/移動) (文件 ID 1674859.1)
- object_id 與data_object_id 的區別Object
- object_id與data_object_id淺析(一)Object
- object_id與data_object_id淺析(二)Object
- object_id與data_object_id的關係Object
- OBJECT_ID、DATA_OBJECT_ID與truncate的本質Object
- How To Find The Object That Causing ORA-600 [kqlnrc_1] (文件 ID 1190673.1)Object
- Object Difference In TTS Migration From 10g To 11g (文件 ID 1643239.1)ObjectTTS
- Oracle中object_id和data_object_id的區別OracleObject
- golang expected declaration, found 'IDENT'GolangIDE
- data_object_id 及 object_id 的聯絡與區別Object
- object_id and data_object_id 區別_20091213Object
- Truncate and data_object_idObject
- OBJECT_ID的重用Object
- Traceback (most recent call last): File "AttributeError: 'NoneType' object has no attribute 'group'ASTErrorNoneObject
- Although it does not provide the most Parajumpers On SaleIDE
- MySQL server PID file could not be found!MySqlServer
- Plugin with id 'com.android.application' not found.PluginAndroidAPP
- Android:Unexpected lock protocol found in lock file. Expected 3, found 0.AndroidProtocol