Sei sulla pagina 1di 5

g:\prints\datapump\Datapump.

txt
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Oracle datapump technology consist of two components.
1)expdp
To unload data objects from database.
2)impdp
To load data objects into database.

To check the parameters in details use


expdp heplp=y and impdp help=y.

Benefits/Advantages of the datapump technology


==================================

The traditional export/import technology was client side based.


The Datapump technology is purely server based.
All dump,log,and other files are created on the server by default.

Ability to restart jobs.


Parallel exection capabilities.
Ability to attach to running jobs.
Network mode of operation.
Ability to estimate space requirements.
Remapping capabilites.

Uses For datapump Export and Import


==================================
1)Backing up the database.
2)Moving database objects from one tablespace to another.
3)Transporting tablespaces between databases.
4)Copying test data from development/testing databases to production or vice versa.
5)Transferring data between oracle databases on different operating system.

Note*:-
========
1)The traditional export/import aren't compatiable with the datapump.
The dump files you create with traditional export/import aren't compatible with the
datapump.

2)Your datapump export and import jobs will not run unless you create a directory
object first and assign file and directory access
privleges on the file system.

3)The default data pump direcctory is DATA_PUMP_DIR.

4)Only privileged users like SYS and SYSTEM can use the default directory object
DATA_PUMP_DIR.
The SYSTEM AND SYS users can export the data without specifying the direcoty name.

==============

First you have to create data pump directory and need to provide necessary grants
on the directory.
Create or replace directory dpump_dir as '/u01/oracle/dump_dir';
grant read,write on directory dpump_dir to wasiq;
Directory parameter will indirectly point to the actual operating system
directories and files.

g:\prints\datapump\export details.txt
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Data pump Export (expdp)

2. Parameter File Interface: Enables you to specify command-line parameters in a


parameter file. The only exception is the PARFILE parameter, because parameter
files cannot be nested.

3. Interactive-Command Interface: Stops logging to the terminal and displays the


Export prompt, from which you can enter various commands, some of which are
specific to interactive-command mode. This mode is enabled by pressing Ctrl+C
during an export operation started with the command-line interface or the parameter
file interface. Interactive-command mode is also enabled when you attach to an
executing or stopped job. For a complete description of the commands available in
interactive-command

ADD_FILE - Add additional dump files.

CONTINUE_CLIENT - Exit interactive mode and enter logging mode.

EXIT_CLIENT - Stop the export client session, but leave the job running.

FILESIZE - Redefine the default size to be used for any subsequent dump files.

HELP - Display a summary of available commands.

KILL_JOB - Detach all currently attached client sessions and kill the current job.

PARALLEL - Increase or decrease the number of active worker processes for the
current job. This command is valid only in the Enterprise Edition of Oracle
Database 10g.

START_JOB - Restart a stopped job to which you are attached.

STATUS - Display detailed status for the current job and/or set statusinterval.

STOP_JOB - Stop the current job for later restart.

Data Pump Export Modes: One of the most significant characteristics of an export
operation is its mode, because the mode largely determines what is exported. Export
provides different modes for unloading different portions of the database. The mode
is specified on the command line, using the appropriate parameter. The available
modes are as follows:

1. Full Export Mode: A full export is specified using the FULL parameter. In a full
database export, the entire database is unloaded. Example:

expdp system/password DIRECTORY=dpump_dir DUMPFILE=expfull.dmp FULL=Y

2. Schema Mode: A schema export is specified using the SCHEMAS parameter. This is
the default export mode. Example:

expdp hr/hr SCHEMAS=hr DIRECTORY=dump_dir DUMPFILE=hr.dmp FLASHBACK_SCN=65610662

expdp hr/hr DIRECTORY=dump_dir SCHEMAS=hr


EXCLUDE=TABLE:"like'EMP'" DUMPFILE=hr_exclude_emp.dmp

expdp hr/hr DIRECTORY=dump_dir SCHEMAS=hr


INCLUDE=TABLE:"like'EM%'" DUMPFILE=hr.dmp

expdp hr/hr DIRECTORY=dump_dir SCHEMAS=hr


ESTIMATE_ONLY = Y EXCLUDE=TABLE:"like 'EMP":"EMP_2005'"

3. Table Mode : A table export is specified using the TABLES parameter. In table
mode, only a specified set of tables, partitions, and their dependent objects are
unloaded. Example:

expdp hr/hr DIRECTORY=dump_dir SCHEMAS=prod7 INCLUDE=TABLE:"like'HR_%'"


DUMPFILE=hr_tables.dmp

expdp hr/hr TABLES=login,emp,salary DIRECTORY=dump_dir DUMPFILE=hr_table.dmp

expdp hr/hr TABLES=emp DIRECTORY=dump_dir DUMPFILE=emp-20080106.dmp


FLASHBACK_SCN=65619542

expdp hr/hr DIRECTORY=dump_dir DUMPFILE=emp.dmp TABLES=EMP:EMP_PART_2005

expdp hr/hr DIRECTORY=dump_dir SCHEMAS=hr EXCLUDE=TABLE:"like'EMP'"


EXCLUDE=TABLE:"SALARY'"

4. Tablespace Mode : A tablespace export is specified using the TABLESPACES


parameter. In tablespace mode, only the tables contained in a specified set of
tablespaces are unloaded. If a table is unloaded, its dependent objects are also
unloaded. Both object metadata and data
are unloaded. In tablespace mode, if any part of a table resides in the specified
set, then that table and all of its dependent objects are exported. Privileged
users get all tables. Example:

expdp system/password DIRECTORY=dpump_dir DUMPFILE=tbs.dmp TABLESPACES=tbs_4,


tbs_5, tbs_6

5. Transportable Tablespace Mode : A transportable tablespace export is specified


using the TRANSPORT_TABLESPACES parameter. In transportable tablespace mode, only
the metadata for the tables (and their dependent objects) within a specified set of
tablespaces are unloaded. This allows
the tablespace datafiles to then be copied to another Oracle database and
incorporated using transportable tablespace import. This mode requires that you
have the EXP_FULL_DATABASE role.
Unlike tablespace mode, transportable tablespace mode requires that the specified
tables be completely self-contained. That is, the partitions of all tables in the
set must also be in the set. Transportable tablespace exports cannot be restarted
once stopped. Also, they cannot have a degree of parallelism greater than 1.
Example:

expdp system/password DIRECTORY=dpump_dir DUMPFILE=tts.dmp


TRANSPORT_TABLESPACES=tbs_1 TRANSPORT_FULL_CHECK=Y LOGFILE=tts.log

++++++++++++++++++++++++++

Modes in Datapump:

There are five different modes of data unloading using expdp. They are,

Full Export Mode (entire database is unloaded)


Schema Mode (this is the default mode, specific schemas are unloaded)
Table Mode (specified set of tables and their dependent objects are unloaded)
Tablespace Mode (the tables in the specified tablespace are unloaded)
Transportable Tablespace Mode (only the metadata for the tables and their dependent
objects within a specified set of tablespaces are unloaded)

+++++++++++++++++++++++++++++++
Uses of datapump export and import.
++++++++++++++++++++++++++++++++
Backing up the oracle database.
Moving database objects from one schema to another.
Moving database objects from one tablespace to another.
Database Re - organization .
Platform Migration.(Migrating databases from development to test or produciton)
Upgrading to new release.
Beauty of datapump is,we can export whole database, but can import only a part of
it.
Transporting tablespaces between databases.

+++++++++++++++++++++++++++++
Advantages of datapump technology
++++++++++++++++++++++++++++++++

The older export/import technology was client based.


The datapump technology is purely server based.All dump,log and other files are
created on the server by default.

1)Ability to restart a failed job.


2)Parallel execution capabilities.
3)Ability to attach to runing jobs.
4)Ability to estimate space requirment.
5)Re mapping capabilities.

Note:Your datapump export and import job will not run unless you create a directory
object first.
Also need to provide necessary privileges on the file system.

Note 2:
The original export and datapump dump are not comptiable.
The export which you have taken using traditional export you can import using
datapump import and vice versa.

NOTE 3:
=========
only privileged users like sys and system can use the default directory object
DATA_PUMP_DIR.
Thus,user system can start a data pump job without providing a directory name.
How to check the directory path?
+++++++++++++++++++++++++++++++++++++
select directory_path from dba_directorires;

Note :
By default,the data pump export utility will run the export in schema mode.

++++++++++++++++++++++++++
How can we monitor datapump jobs?
+++++++++++++++++++++++++++++++
select * from dba_datapump_jobs;

Potrebbero piacerti anche