How to change Oracle default data pump directory to import dumpfile?
I want change default directory dumpfile.
You could create a new directory and give it required privileges, for example:
SQL> CREATE DIRECTORY dmpdir AS '/opt/oracle';
Directory created.
SQL> GRANT read, write ON DIRECTORY dmpdir TO scott;
Grant succeeded.
To use the newly created directory, you could just add it as a parameter:
DIRECTORY=dmpdir
Oracle introduced a default directory from 10g R2, called DATA_PUMP_DIR, that can be used. To check the location, you could look into dba_directories:
SQL> select DIRECTORY_NAME, DIRECTORY_PATH from dba_directories where DIRECTORY_NAME = 'DATA_PUMP_DIR';
DIRECTORY_NAME DIRECTORY_PATH
-------------------- --------------------------------------------------
DATA_PUMP_DIR C:\app\Lalit/admin/orcl/dpdump/
SQL>
With the directory
parameter:
impdp system/password@$ORACLE_SID schemas=USER_SCHEMA directory=MY_DIR \
dumpfile=mydumpfile.dmp logfile=impdpmydumpfile.log
The default directory is DATA_PUMP_DIR
, which is presumably set to /u01/app/oracle/admin/mydatabase/dpdump
on your system.
To use a different directory you (or your DBA) will have to create a new directory object in the database, which points to the Oracle-visible operating system directory you put the file into, and assign privileges to the user doing the import.