Let's Join and share our day to day activities, Views, Knowledge, Questions and achievements in Oracle Database (8i / 9i / 10g or 11g)

Dec 8, 2010

Data Pump Export and Import - Step by Step

Setup both your source and target database:

1. sqlplus to source and target DB as sys or system.

2. create directory with the following command:

CREATE DIRECTORY dpump_dir1 AS 'Z:\output_dir';

– “Z:\output_dir” can be any directory where you want the exported dump file to go.

3. Exit sqlplus.

4. Run the following command to export using data pump:

expdp system/[PASSWORD]@[SID] schemas=[SCHEMA] DIRECTORY=dpump_dir1 JOB_NAME=hr DUMPFILE=[SCHEMA]_[SID]_%u.dmp PARALLEL=4

– replace strings in [ ] with the ones for your environment.

5. Run the following command to import using data pump:

impdp system/[PASSWORD]@[SID] schemas=[SCHEMA] DIRECTORY=dpump_dir1 JOB_NAME=hr DUMPFILE=[SCHEMA]_[SID]_%u.dmp PARALLEL=8

– replace strings in [ ] with the ones for your environment.

Notes:

- If your target database is on another host, be aware of the directory setup.

- If you want to import into existing table, simply add TABLE_EXISTS_ACTION=APPEND as part of the command.

- If you only want to import certain tables, use TABLES=[TABLE_NAME1,TABLE_NAME2 ...etc].

- You can also use TABLE_EXISTS_ACTION=TRUNCATE to first truncate the target table before the import.

- You can adjust PARALLEL parameter depending on the number of CPUs on your system.

4 comments:

  1. Hello my loved one! I wish to say that this article is awesome, great written and include almost all important infos.
    I'd like to look more posts like this .

    Also visit my web-site: http://printablepoweradecoupons.weebly.com

    ReplyDelete
  2. I every time spent my half an hour to read this weblog's posts all the time along with a cup of coffee.

    my web page ... st patrick's day

    ReplyDelete
  3. I love reading through a post that can make men and women think.
    Also, thanks for allowing for me to comment!

    Feel free to visit my weblog; tesco money off coupons

    ReplyDelete
  4. Good article. I absolutely love this site. Keep
    it up!

    My blog post ... soft drinks

    ReplyDelete