EXPDP and IMPDP Directory

On March 9, 2007, in EXPORT-IMPORT, by

Hi,

As we know with oracle 10g we export datapump utility ofr taking the export and impdp for import.Now expdp as well as impdp requires directory to be created so that all the exports taken are stores in that directory and all the import dumps which are read by impdp will read from that directory.

So, before using expdp and impdp we need to create directory ,so this post is mainly meant for creation of directory

First we need to create a directory at the OS level using OS commands at a suitable path where you want your export dump to be stored .

So, after the creation of directory at the os level enter in the sqlplus as system

sqlplus system/manager

WINDOWS

SQL> create or replace directory my_dir as ‘D:my_dir’;

SQL> grant read,write on DIRECTORY my_dir to public;

UNIX

SQL> create or replace directory my_dir as ‘/oracle/backup/export’

SQL> grant read,write on DIRECTORY my_dir to public;

Thus now u can use this directory while taking your export using expdp or while taking import using impdp

the syntax for expdp is as shown:

# expdp system/manager directory=my_dir dumpfile=exp_tab.dmp logfile=exp_tab.log full=y;

Similarly

# impdp  system/manager directory=my_dir dumpfile=exp_tab.dmp logfile=imp_tab.log full=y;

Also if you can have any other directory created where  can keep your logfiles.The Method to create the directory is similar as mentoned above and u can specify that your logfiles should be placed in that directory by using following syntax

#expdp system/manager directory=my_dir dumpfile=exp_tab.dmp logfile=log_dir:exp_tab.log  full=y;

Thanks and Regards

Parikshit

 

1 Response » to “EXPDP and IMPDP Directory”

  1. love kumar says:

    expdp scott/tiger directory=dump_dir dumpfile=scott.emp logfile=log_dir:scott.log full=y

    Export: Release 10.2.0.1.0 – Production on Friday, 11 March, 2011 16:58:50

    Copyright (c) 2003, 2005, Oracle. All rights reserved.

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
    With the Partitioning, OLAP and Data Mining options
    Starting “SCOTT”.”SYS_EXPORT_SCHEMA_01″: scott/******** directory=dump_dir dumpfile=scott.emp logfile=log_dir:scott.log
    Estimate in progress using BLOCKS method…
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 320 KB
    Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
    Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type SCHEMA_EXPORT/TABLE/COMMENT
    Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
    Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported “SCOTT”.”DEPT” 5.656 KB 4 rows
    . . exported “SCOTT”.”EMP” 7.820 KB 14 rows
    . . exported “SCOTT”.”MYTABLE” 5.375 KB 8 rows
    . . exported “SCOTT”.”SALGRADE” 5.585 KB 5 rows
    . . exported “SCOTT”.”XXX” 21.62 KB 1269 rows
    . . exported “SCOTT”.”BONUS” 0 KB 0 rows
    Master table “SCOTT”.”SYS_EXPORT_SCHEMA_01″ successfully loaded/unloaded
    ******************************************************************************
    Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
    /export/home/oracle/dumps/scott.emp
    Job “SCOTT”.”SYS_EXPORT_SCHEMA_01″ successfully completed at 16:58:54

    -bash-3.00$ expdp scott/tiger directory=dump_dir dumpfile=scott.em logfile=log_dir:scott.lo full=y

    Export: Release 10.2.0.1.0 – Production on Friday, 11 March, 2011 17:02:20

    Copyright (c) 2003, 2005, Oracle. All rights reserved.

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
    With the Partitioning, OLAP and Data Mining options
    ORA-31631: privileges are required
    ORA-39161: Full database jobs require privileges

    how to leave this error

Leave a Reply