Skip to Main Content
  • Questions
  • expdp/impdp with Full Database but need only METADATA

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Akshay.

Asked: May 18, 2016 - 3:08 pm UTC

Last updated: August 19, 2016 - 3:13 am UTC

Version: 11.1.0

Viewed 10K+ times! This question is

You Asked

i want to do expdp and impdp of full database but condition is METADATA_ONLY.

SOURCE DATABASE IS 11.1.0 and TARGET DATABASE IS 11.2.0.

Please tell

a. while exporting and importing which user should be used to export.
b. FULL=Y, CONTENT=METADATA are these ok becuase i am planning to use while exporting
c. please suggest parameter while importing because it give error while importing like objects already exsists etc
d. target database is higher version then source database so, should i use version parameter for it?
e. i need to import METADATA_ONLY without any error. (tried igonre=y parameter)

Regards,
Akshay

and Connor said...

a) SYSTEM or SYS
b) yes
c) TABLE_EXISTS_ACTION=SKIP
d) make sure you run the 11.2 impdp
e) see (c)

Hope this helps.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Just a thought

Peter, May 25, 2016 - 2:02 pm UTC

From the question I am wondering if the user wants not METADATA but the SQL to create the tables ?
expdp / content=metadata_only full =y directory = expdp_dir dumpfile=md.dmp
impdp / directory=expdp_dir dumpfile=md.dmp sqlfile=md.sql
Chris Saxon
May 26, 2016 - 3:55 am UTC

Good point, and thanks for the input.

Alex, August 16, 2016 - 3:46 pm UTC

Is there anyway to use expdp to copy pl/sql objects using the table mode? I need to migrate objects out of one huge schema into smaller individual ones. Since this needs to be done many times over it would be great to not have to extract the ddl for each object but I didn't see a way to achieve this.

Thanks.
Chris Saxon
August 19, 2016 - 3:13 am UTC

How about using INCLUDE, eg

C:\Users\comcdona>expdp schemas=MCDONAC include=PROCEDURE include=FUNCTION include=PACKAGE include=TYPE directory=TEMP dumpfile=demo.dmp logfile=demo.log

Export: Release 12.1.0.2.0 - Production on Fri Aug 19 11:12:07 2016

Copyright (c) 1982, 2016, Oracle and/or its affiliates.  All rights reserved.

Username: mcdonac/******

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "MCDONAC"."SYS_EXPORT_SCHEMA_01":  mcdonac/******** schemas=MCDONAC include=PROCEDURE include=FUNCTION include=PACKAGE include=TYPE directory=TEMP dumpfile=demo.dmp logfile=demo.log
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
Processing object type SCHEMA_EXPORT/TYPE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
Processing object type SCHEMA_EXPORT/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
Processing object type SCHEMA_EXPORT/TYPE/TYPE_BODY
Master table "MCDONAC"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for MCDONAC.SYS_EXPORT_SCHEMA_01 is:


More to Explore

Data Pump

All of the database utilities including Data Pump are explained in the Utilities guide.