- SOURCE_EDITION parameter used in export datapump process.
- Oracle provides the provision for different versions of same object under different editions. Suppose if you wanted to backup and restore these versions into across different editions using these options.
- During the application development you can create multiple versions of objects for different releases. So in case if you wanted to migrate code from one version to different version within database or across database you can use this option.
-
The objects are limited to some set of objects which is not having the storage.
EDITIONABLE AND NONEDITIONABLE SCHEMA OBJECT TYPES :
These schema objects types are editionable:
- SYNONYM
- VIEW
- All PL/SQL object types:
- FUNCTION
- LIBRARY
- PACKAGE and PACKAGE BODY
- PROCEDURE
- TRIGGER
- TYPE and TYPE BODY
- All other schema object types are noneditionable. Table is an example of an noneditionable type.
- A schema object of an editionable type is editioned if its owner is editions-enabled; otherwise, it is potentially editioned.
- A schema object of a noneditionable type is always noneditioned, even if its owner is editions-enabled. A table is an example of an noneditioned object.
Grant access to HARI user to create edition
SQL> GRANT CREATE ANY EDITION, DROP ANY EDITION to HARI; Grant succeeded.
Enabling edition for a user HARI
SQL> select USERNAME,EDITIONS_ENABLED from dba_users where USERNAME='HARI';
USERNAME E
----------- ---
HARI N
SQL> alter user HARI enable editions;
User altered.
SQL> grant create any view to HARI;
Grant succeeded.
SQL> select USERNAME,EDITIONS_ENABLED from dba_users where USERNAME='HARI';
USERNAME E
----------- ---
HARI Y
Check the current & new edition for HARI
SQL> conn hari/oracle; Connected. SQL> create edition NEW_EDITION; Edition created. SQL> SELECT SYS_CONTEXT('userenv', 'current_edition_name') FROM DUAL; SYS_CONTEXT('USERENV','CURRENT_EDITION_NAME') ----------------------------------------------- ORA$BASE SQL> create editioning view ED_EMP_VIEW_ORABASE as select ID,SAL from emp_data; View created. SQL> desc ed_emp_view_ORABASE; Name Null? Type ----- ---- ------ ID NUMBER SAL NUMBER SQL> alter session set edition=NEW_EDITION; Session altered. SQL> SELECT SYS_CONTEXT('userenv', 'current_edition_name') FROM DUAL; SYS_CONTEXT('USERENV','CURRENT_EDITION_NAME') ----------------------------------------------- NEW_EDITION
Take the export view
[oracle@18c empdata]$ expdp dumpfile=edition.dmp schemas=HARI include=view directory=TEST_DIR source_edition=NEW_EDITION Export: Release 18.0.0.0.0 - Production on Sat Aug 25 02:20:35 2018 Version 18.3.0.0.0 Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved. Username: hari Password: Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production Starting "HARI"."SYS_EXPORT_SCHEMA_05": hari/******** dumpfile=edition.dmp schemas=HARI include=view directory=TEST_DIR source_edition=NEW_EDITION Processing object type SCHEMA_EXPORT/VIEW/VIEW Master table "HARI"."SYS_EXPORT_SCHEMA_05" successfully loaded/unloaded ****************************************************************************** Dump file set for HARI.SYS_EXPORT_SCHEMA_05 is: /u01/empdata/edition.dmp Job "HARI"."SYS_EXPORT_SCHEMA_05" successfully completed at Sat Aug 25 02:20:52 2018 elapsed 0 00:00:12
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