Skip to Main Content
  • Questions
  • EXPDP - tables only and only certain Schemas

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Greg.

Asked: February 26, 2018 - 5:37 pm UTC

Last updated: February 27, 2018 - 3:22 am UTC

Version: 12

Viewed 10K+ times! This question is

You Asked

Hi
I want to do a datapupm export from one database, and then do a datapump import back into another database.
I only want to export tables, and only those belonging to two users - say USER1, USER2

So I plan to do an EXPDP with the following arguments

expdp .... INCLUDE=TABLE, SCHEMA:”IN(‘USER1’,’USER2’)



The documention at
https://docs.oracle.com/cd/B28359_01/server.111/b28319/dp_import.htm#i1007761
says query the view SCHEMA_EXPORT_OBJECTS for schema mode. Don't know what this means - but there is a row with an OBJECT_PATH = TABLE - so would expect

However, other documentation for expdp - see https://oracle-base.com/articles/10g/oracle-data-pump-10g#IncludeExclude
seems to indicate that you can INCLUDE=TABLE_DATA

So, should I specify TABLE_DATA or TABLE ?

Thanks

and Connor said...

Sorry, in most of Tim's examples, I see a reference to "INCLUDE=TABLE" not TABLE_DATA

For example

x.par
=====
dumpfile=blah
directory=TEMP
full=y
INCLUDE=TABLE, SCHEMA:"IN('SCOTT','HR')"

C:\>expdp userid=mcdonac/***** parfile=x.par

Export: Release 12.2.0.1.0 - Production on Tue Feb 27 11:17:04 2018

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

Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Starting "MCDONAC"."SYS_EXPORT_FULL_01":  userid=mcdonac/******** parfile=c:\temp\x.par
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE_BODIES/PACKAGE/PACKAGE_BODY
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/ROLE_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLESPACE_QUOTA
Processing object type DATABASE_EXPORT/SCHEMA/DB_LINK
Processing object type DATABASE_EXPORT/SCHEMA/SEQUENCE/SEQUENCE
Processing object type DATABASE_EXPORT/SCHEMA/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/SYNONYM
Processing object type DATABASE_EXPORT/SCHEMA/TYPE/TYPE_SPEC
Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/AUDIT_OBJ
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/PACKAGE_SPEC
Processing object type DATABASE_EXPORT/SCHEMA/FUNCTION/FUNCTION
Processing object type DATABASE_EXPORT/SCHEMA/PROCEDURE/PROCEDURE
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
Processing object type DATABASE_EXPORT/SCHEMA/FUNCTION/ALTER_FUNCTION
Processing object type DATABASE_EXPORT/SCHEMA/PROCEDURE/ALTER_PROCEDURE
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/VIEW
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/INDEX
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/CONSTRAINT
Processing object type DATABASE_EXPORT/SCHEMA/JAVA_SOURCE/JAVA_SOURCE
Processing object type DATABASE_EXPORT/SCHEMA/JAVA_CLASS/JAVA_CLASS
Processing object type DATABASE_EXPORT/SCHEMA/JAVA_RESOURCE/JAVA_RESOURCE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TRIGGER
. . exported "SCOTT"."SYS_EXPORT_SCHEMA_02"              655.3 KB    1714 rows
. . exported "SCOTT"."SYS_EXPORT_SCHEMA_01"              455.0 KB    1677 rows
. . exported "HR"."EMPLOYEES"                            17.08 KB     107 rows
. . exported "SCOTT"."EMP$"                              8.796 KB      15 rows
. . exported "SCOTT"."BLAH"                              8.773 KB      14 rows
. . exported "SCOTT"."EMP"                               8.781 KB      14 rows
. . exported "SCOTT"."EMP2"                              8.789 KB      14 rows
. . exported "HR"."LOCATIONS"                            8.437 KB      23 rows
. . exported "HR"."JOB_HISTORY"                          7.195 KB      10 rows
. . exported "HR"."JOBS"                                 7.109 KB      19 rows
. . exported "HR"."DEPARTMENTS"                          7.125 KB      27 rows
. . exported "HR"."COUNTRIES"                            6.367 KB      25 rows
. . exported "SCOTT"."SALGRADE"                          6.023 KB      10 rows
. . exported "SCOTT"."DEPT"                              6.023 KB       4 rows
. . exported "HR"."REGIONS"                              5.546 KB       4 rows
. . exported "SCOTT"."BONUS"                                 0 KB       0 rows
. . exported "SCOTT"."CREATE$JAVA$LOB$TABLE"                 0 KB       0 rows
Master table "MCDONAC"."SYS_EXPORT_FULL_01" successfully loaded/unloaded
******************************************************************************
Dump file set for MCDONAC.SYS_EXPORT_FULL_01 is:
  C:\TEMP\BLAH.DMP
Job "MCDONAC"."SYS_EXPORT_FULL_01" successfully completed at Tue Feb 27 11:18:52 2018 elapsed 0 00:01:48



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

More to Explore

Data Pump

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