Export View as Table
The VIEWS_AS_TABLES parameter allows Data Pump to export the specified views as if they were tables.
The table structure matches the view columns, with the data being the rows returned by the query supporting the views.
VIEWS_AS_TABLES=[schema_name.]view_name[:table_name], …
Create a view for Demo:-
SQL> conn scott/tiger
Connected.
SQL> CREATE VIEW oraview as SELECT * FROM oracledbwr;
View created.
Now export the view using the VIEWS_AS_TABLES parameter.
[oracle@prod101:admin orcl101] expdp scott/tiger views_as_tables=oraview directory=test_dir dumpfile=oraview.dmp logfile=oraview.log
Export: Release 18.0.0.0.0 - Production on Fri Aug 24 03:49:16 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/******** views_as_tables=oraview directory=test_dir dumpfile=oraview.dmp logfile=oraview.log
Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE_DATA
Processing object type TABLE_EXPORT/VIEWS_AS_TABLES/TABLE
. . exported "SCOTT"."ORAVIEW" 17.29 KB 1792 rows
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
/u01/app/oracle/datapump/oraview.dmp
Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at Fri Aug 24 03:49:22 2018 elapsed 0 00:00:05
Catch Me On:- Hariprasath Rajaram
Telegram:https://t.me/joinchat/I_f4DhGF_Zifr9YZvvMkRg
LinkedIn:https://www.linkedin.com/in/hari-prasath-aa65bb19/
Facebook:https://www.facebook.com/HariPrasathdba
FB Group:https://www.facebook.com/groups/894402327369506/
FB Page: https://www.facebook.com/dbahariprasath/?
Twitter: https://twitter.com/hariprasathdba