Professional Documents
Culture Documents
How to export
• Subset of a table
expdp hr/hr dumpfile=expdir:job_tabs.dmp
QUERY=hr.employees:"WHERE department_id in (10,20) and
salary 1600 ORDER BY department_id"
Export Parameters
How to import
• Read the dump file HR.DMP and write to the SQL file
HR_proc_give.sql all the DDL to create any procedures
with a name LIKE 'GIVE%'. Do not write a log file.
impdp system/password full=y dumpfile=expdir:HR.DMP
nologfile=y sqlfile=expdir:HR_proc_give.SQL
include=PROCEDURE:"LIKE 'GIVE%'"
Import Parameters
• Full=y Specifies a full mode import.
• Schemas=schema_list Specifies a schema mode import.
schema_list is a comma-delimited list of schemas to
import.
• Tables=table_list Specifies a table mode import.
table_list is a comma delimitedlist of tables to
import.
• tablesspaces=tablespace_list Specifies a tablespace
mode import. tablespace_list is a comma-delimited list
of tablespaces to import.
• content=content_option Specifies whether data,
metadata, or both are imported. Valid values are:
DATA_ONLY (data only), METADATA_ONLY (metadata only),
and the default ALL (both).
• network_link=db_link Specifies the live database
accessed via the database link. db_link should be used
as the import source.
• dumpfile=dir:file Specifies the dump file location and
name. dir is a database directory object. file is the
filename.
• logfile=dir:file Specifies the log file location and
name. dir is a database directory object. file is the
filename.
• directory=dir Specifies the file location to use for
both the dump file and log file. dir is a database
directory object.
• nologfile=y Specifies that no log file should be
written.
• sqlfile=dir:file Specifies the file location and name
to write the metadata/DDL statements to.
• job_name=identifier Specifies a name for the import
job. This name is visible from data dictionary views.
The default is system generated.
• parallel=degree Specifies the maximum number of active
threads/processes operating on behalf of the import.
The default is 1.
• parfile=dir:file Specifies the file location and name
of the parameter file that Data Pump Import should
use.
• remap_datafile=source:target Specifies how to change
the source and target datafile names that appear in
CREATE TABLESPACE, CREATE LIBRARY and CREATE DIRECTORY
statements. source is the datafile name from the
export or live database. target is the datafile name
to use in the import.
• remap_schema=source:target Specifies the source and
target schema names when importing into a different
schema than the export was taken from. Multiple
remap_schema entries can be used. source is the schema
from the export or live database. target is the schema
to import into.
• remap_tablespace=source:target Specifies the source
and target tablespace names when they change between
the source export files / live database and target
database. Multiple remap_tablespace entries can be
used. source is the tablespace name from the export or
live database. target is the tablespace name that the
source objects should be placed in.
• include=object_list Specifies a comma-delimited list
of object types to include in the import.
• exclude=object_list Specifies a comma-delimited list
of object types to exclude from the import.
Advantages of Datapump