Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

expdp view_as_tables Tips

Oracle Tips by Burleson Consulting

January 3, 2013

Prior to release 12c, Oracle expdp sometime has to go through complex gyrations when exporting view information, and Oracle has overcome this limitation by introducing the view_as_tables argument to expdp. 

Invoked as "view_as_tables=scott.empview" the view_as_tables transforms a view at the source database into a table at the destination database, exporting all of the the columns of the view as-if they were table columns.

In a sense, the view_as_tables is an ad-hoc materialized view generator because the result set has been transformed from a view to a table.

In  a case where only a small portion of a complex view is exported with view_as_tables, all unnecessary details that maintain the complex view are omitted.

Note:  You cannot use expdp with the view_as_tables if you are choosing a LOB datatype column from the view.

Template tables are automatically dropped after the export operation is completed. While they exist, you can perform the following query to view their names (which all begin with KU$VAT):

select
   *
from
   user_tab_comments
where
   table_name like 'KU$VAT%'

For example, here we export a view called scott.myview using views_as_tables, naming it newtab1:

$ expdp xff/xifenfei views_as_tables=scott.myview:newtab1 directory=data_pump_dir dumpfile=xifenfei.dmp
Export: Release 12.1.0.0.2 - Beta on Sun Dec 16 07:56:48 2015
Copyright (c) 1982, 2015, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.0.2 - 64bit Beta
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "XFF"."SYS_EXPORT_TABLE_01":xff/******** views_as_tables=v_xifenfei directory=data_pump_dir
dumpfile=xifenfei.dmp
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 "XFF"."V_XIFENFEI" 7.390 KB 3 rows
Master table "XFF"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded

 

The view_as_tables allows you to specify a vie w as if it was a table and then make it into a table when using impdp:

$ impdp xff/xifenfei tables=v_xifenfei directory=data_pump_dir dumpfile=xifenfei.dmp
Import: Release 12.1.0.0.2 - Beta on Sun Dec 16 07:59:05 2015
Copyright (c) 1982, 2015, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.0.2 - 64bit Beta
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "XFF"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "XFF"."SYS_IMPORT_TABLE_01": xff/******** tables=v_xifenfei directory=data_pump_dir
dumpfile=xifenfei.dmp
Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE
ORA-39325: TABLE_EXISTS_ACTION cannot be applied to "XFF"."V_XIFENFEI".
Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE_DATA
Job "XFF"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at Sun Dec 16 07:59:13 2015 elapsed 0 00:00:05

 

 
 
 
Get the Complete
Oracle Utility Information 

The landmark book "Advanced Oracle Utilities The Definitive Reference"  contains over 600 pages of filled with valuable information on Oracle's secret utilities. This book includes scripts and tools to hypercharge Oracle 11g performance and you can buy it for 30% off directly from the publisher.
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster