You are on page 1of 28

DATAPUMP UTILITY

INTRODUCTION: The Data Pump Utility runs on the Server Side. Oracle Data Pump technology enables very high-speed movement of data and metadata from one database to another.Dump files generated by the new data pump export utility are not compatible with dump files generated by the original export utility. Therefore, files generated by the original Export (exp) utility cannot be imported with the Data Pump Import(impdp) utility.

BENEFITS OF DATA PUMP UTILITY 1) The ability to restart Data Pump Jobs 2) The ability to detach from and reattach to long running jobs without affecting the job itself. 3) Support for filtering the metadata that is exported and imported based upon objects and object types. 4) Data Archival 5) Upgrading to new releases. 6) Backing up Oracle Databaes 7) Moving Between from One Datbase to another database.

DATA PUMP EXPORT With the help of expdp utility of DATAPUMP, We can take export(Logiacal Backup) of Database. This is similar utility like our old exp utility of previous oracle databases. There are various modes to take export using Expdp utility. 1) 2) 3) 4) 5) Full Database Export Full Schema Export Particualar Table Export Tablespace export Using query option export.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 1

HOW TO START DATAPUMP? 1) First Login as sysdba user to sql*plus.

Then go to ORACLE installed drive from MY computer. Create Physically create directory. Named DATA.

Give

DOCUMENT PREPARED BY AMEY KULKARNI

Page 2

Now Again Connect to SQL*PLUS. Create a directory using SQL*PLUS. And give read,write grants to public.

EXPDP Utiltiy of DATAPUMP DOCUMENT PREPARED BY AMEY KULKARNI Page 3

With the Help of this utility we can take Logical Backup. Its more faster than previous exp utility. Full Export of Database using DATAPUMP. We can take full database export using Datapump. The Detail step are as Below: 1) Click on Start Menu Prompt opened. go to Run Menu Type cmd click on ok Button. Now Dos

2) Now go to our DATA DIRECTORY where we store our Backup.

Now We Want to Perform Full Database Backup -

using system or sys user.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 4

Command: Expdp system/x@orcl directory=DATA dumpfile=full_db.dmp logfile=full_db.log exclude=grants,statistics full=y job_name=full_db (Press Enter Key) Parameter is: full=y

Our full Export Started Successfully.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 5

DOCUMENT PREPARED BY AMEY KULKARNI

Page 6

Now our Full export runs successfully.

SCHEMA LEVEL EXPORT If you Want any specific Users Objects Backup, then you can used Schema Level Export utility of Expdp. Parameter is: schemas=<user Name>

DOCUMENT PREPARED BY AMEY KULKARNI

Page 7

Command is: Expdp system/x@orcl directory=DATA dumpfile=scott_schema_bkp.dmp logfile=scott_schema_bkp.log exclude=grants,statistics schemas=scott

DOCUMENT PREPARED BY AMEY KULKARNI

Page 8

Now our Schema Export Runs successfully.

TABLE LEVEL EXPORT If you Want Specific tables of particular schema, then Used Table Level Export Mode using DATA PUMP UTILITY. Parameter is : tables=<specific tables name>

DOCUMENT PREPARED BY AMEY KULKARNI

Page 9

Command is: Expdp hr/hr@orcl directory=DATA dumpfile=sp_tab.dmp logfile=sp_tab.log exclude=grants,statistics tables=regions,jobs

Now our Table Level Backup successful.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 10

Multiple Tables Backup using par file Option in DATAPUMP If you want specific tables backup more than 2 tables then with the help of parfile option in datapump , We can take tables backup more than once. Steps to create a parfile in Windows: 1) Create a text file, using Notepad. 2) Specify tables=<table list> separated by Comma operator of that particular schemas. 3) Save This File in our DATA DIRECTORY.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 11

Command is: Expdp hr/hr@orcl directory=DATA dumpfile=parfiledemo.dmp logfile=parfiledemo.log parfile=parfile.txt exclude=grants,statistics Parameter is: parfile=<textfile name>

DOCUMENT PREPARED BY AMEY KULKARNI

Page 12

Our Backup Successful Now.

Tablespace Level Backup If you Want any particular tablespace backup then, with the help of the parameter of datapump, you can take Logical backup.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 13

First Identify the tablespace that you want to take backup in datapump.

(Press Enter Key) Parameter Used. Tablespaces=<tablespace name>

DOCUMENT PREPARED BY AMEY KULKARNI

Page 14

STRUCTURAL LEVEL BACKUP If you Want any particular tables Structure, then With the Help of this Option, We can take only structure Backup.

Command is: Expdp hr/hr@orcl directory=DATA dumpfile=struemp.dmp logfile=struemp.log exclude=grants,statistics content=METADATA_ONLY tables=jobs Parameter is: 1) Content=METADATA_ONLY(always specify this Parameter) 2) Tables=< specify table name that you that tables structure)

DOCUMENT PREPARED BY AMEY KULKARNI

Page 15

Now our structure Backup runs successfully.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 16

QUERY LEVEL EXPORT BACKUP If you Want Particular Table Specify data, Then you can used Query Option of DataPump. PARAMETER is: 1) Query=<specify the term of query> 2) TABLES=<specify table Name>

Now our Backup Successful.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 17

HELP of expdp If you Want Help of expdp then specify expdp help=y you will get all options of expdp utility.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 18

IMPORT UTILITY OF DATAPUMP With the Help of of IMPDP utility we can restore logical Backup from one database to another, across platforms between different operating systems.

FULL IMPORT OF DATABASE : We can Restore the data to demo user.

Command is: Impdp system/x@orcl directory=DATA dumpfile=FULL_DB.DMP logfile=imp_FULL_DB.log remap_schema=system:demo table_exists_action=append

DOCUMENT PREPARED BY AMEY KULKARNI

Page 19

Schema level Import With this option we can restore the schema from one schema to another.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 20

Our Import complets successfully.

SPECIFIC TABLES IMPORT

DOCUMENT PREPARED BY AMEY KULKARNI

Page 21

Command is: Impdp system/x@orcl directory=DATA dumpfile=SP_TAB.DMP logfile=imp_SP_TAB.log remap_schema=hr:hr1 (PRESS ENTER KEY) Or Impdp system/x@orcl directory=DATA dumpfile=SP_TAB.DMP logfile=imp_sp_tab.log tables=jobs,regions (Press Enter Key)

PAR FILE IMPORT With the Help of Par File, We can restored Multiple tables.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 22

Our Import Runs successfully. Command is: Impdp system/x@orcl dumpfile=PARFILEDEMO.DMP directory=DATA logfile=impparfile.log remap_schema=hr:hr1 Or Impdp hr/hr@orcl dumpfile=PARFILEDEMO.DMP directory=DATA logfile=impparfile.log (press enter key)

QUERY LEVEL IMPORT With the Help of this Mode ,we can restore specific tables.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 23

Command is: Impdp system/x@orcl directory=DATA dumpfile=QUERYDEMO.DMP logfile=impquerydemo.log remap_schema=hr:demo

STRUCTURE TABLE IMPORT : We can restored the only Structure of that Tables from one schema to another. DOCUMENT PREPARED BY AMEY KULKARNI Page 24

TABLESPACE LEVEL IMPORT DOCUMENT PREPARED BY AMEY KULKARNI Page 25

Remap_tablespace option, we can import our tablespace from one schema to another or from one database to another.

Command is: Impdp system/x@orcl directory=DATA dumpfile=TABLESPACEDEMO.DMP LOGFILE=imptablespacedemo.log remap_tablespace=users:demo table_exists_action=truncate

Help of Impdp If you want any help of impdp then simply type impdp help=y command. Help displayed on your screen.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 26

DOCUMENT PREPARED BY AMEY KULKARNI

Page 27

How to Kill the Job? Type ctrl+c key then at command prompt type kill_job(Press Enter key) job. type yes to kill the

Version Parameter of Data Pump Utility. With the Help of Version Parameter, You can take logical backup across different Oracle Versions; Expdp Utility from Oracle 10g to 11g There is No need to specify version parameter in expdp command while exporting from 10g to11gr2 releases Impdp Utility from Oracle 11gr2 to 10g When we take export from 11gr2 version, and We Want to import that Export to 10g Version that time, You Must specify version parameter.

Important Views of DATAPUMP 1) DBA_DATAPUMP_JOBS 2) USER_DATAPUMP_JOBS 3) DBA_DIRECTORIES.

DOCUMENT PREPARED BY AMEY KULKARNI

Page 28

You might also like