4.3 Management of File Locations in Oracle Data Pump Legacy Mode
Original Export and Import and Oracle Data Pump Export and Import differ on where dump files and log files can be written to and read from, because the original version is client-based, and Data Pump is server-based.
Original Export and Import used the FILE
and
LOG
parameters to specify dump file and log file names,
respectively. These file names always refer to files local to the client system. They
can also contain a path specification.
Oracle Data Pump Export and Import used the DUMPFILE
and
LOGFILE
parameters to specify dump file and log file names,
respectively. These file names always refer to files local to the server system, and
cannot contain any path information. Instead, a directory object is used to indirectly
specify path information. The path value defined by the directory object must be
accessible to the server. The directory object is specified for an Oracle Data Pump job
through the DIRECTORY
parameter. It is also possible to prepend a
directory object to the file names passed to the DUMPFILE
and
LOGFILE
parameters. For privileged users, Oracle Data Pump supports
the use of a default directory object if one is not specified on the command line. This
default directory object, DATA_PUMP_DIR
, is set up at installation
time.
If Oracle Data Pump legacy mode is enabled, and if the original Export
FILE=filespec
parameter and/or
LOG=filespec
parameter are
present on the command line, then the following rules of precedence are used to
determine file location:
-
If the
FILE
parameter andLOG
parameter are both present on the command line, then the rules of precedence are applied separately to each parameter. -
If a mix of original Export/Import and Oracle Data Pump Export/Import parameters are used, then separate rules apply to them.
For example, suppose you have the following command:
expdp system FILE=/user/disk/foo.dmp LOGFILE=foo.log DIRECTORY=dpump_dir
In this case, the Oracle Data Pump legacy mode file management rules, as explained in this section, apply to the
FILE
parameter. The normal (that is, non-legacy mode) Oracle Data Pump file management rules for default locations of Dump, Log, and SQL files locations apply to theLOGFILE
parameter.
Example 4-1 Oracle Data Pump Legacy Mode File Management Rules Applied
File management proceeds in the following sequence:
-
If you specify a path location as part of the file specification, then Oracle Data Pump attempts to look for a directory object accessible to the schema running the export job whose path location matches the path location of the file specification. If such a directory object cannot be found, then an error is returned. For example, suppose that you defined a server-based directory object named
USER_DUMP_FILES
with a path value of'/disk1/user1/dumpfiles/'
, and that read and write access to this directory object has been granted to thehr
schema. The following command causes Oracle Data Pump to look for a server-based directory object whose path value contains'/disk1/user1/dumpfiles/'
and to which thehr
schema has been granted read and write access:expdp hr FILE=/disk1/user1/dumpfiles/hrdata.dmp
In this case, Oracle Data Pump uses the directory object
USER_DUMP_FILES
. The path value, in this example'/disk1/user1/dumpfiles/'
, must refer to a path on the server system that is accessible to Oracle Database.If a path location is specified as part of the file specification, then any directory object provided using the
DIRECTORY
parameter is ignored. For example, if you issue the following command, then Oracle Data Pump does not use theDPUMP_DIR
directory object for the file parameter, but instead looks for a server-based directory object whose path value contains'/disk1/user1/dumpfiles/'
and to which thehr
schema has been granted read and write access:expdp hr FILE=/disk1/user1/dumpfiles/hrdata.dmp DIRECTORY=dpump_dir
-
If you have not specified a path location as part of the file specification, then the directory object named by the
DIRECTORY
parameter is used. For example, if you issue the following command, then Oracle Data Pump applies the path location defined for theDPUMP_DIR
directory object to thehrdata.dmp
file:expdp hr FILE=hrdata.dmp DIRECTORY=dpump_dir
-
If you specify no path location as part of the file specification, and no directory object is named by the
DIRECTORY
parameter, then Oracle Data Pump does the following, in the order shown:-
Oracle Data Pump looks for the existence of a directory object of the form
DATA_PUMP_DIR_schema_name
, whereschema_name
is the schema that is running the Oracle Data Pump job. For example, if you issued the following command, then it would cause Oracle Data Pump to look for the existence of a server-based directory object namedDATA_PUMP_DIR_HR
:expdp hr FILE=hrdata.dmp
The
hr
schema also must have been granted read and write access to this directory object. If such a directory object does not exist, then the process moves to step b. -
Oracle Data Pump looks for the existence of the client-based environment variable
DATA_PUMP_DIR
. For instance, suppose that a server-based directory object namedDUMP_FILES1
has been defined, and thehr
schema has been granted read and write access to it. Then on the client system, you can set the environment variableDATA_PUMP_DIR
to point toDUMP_FILES1
as follows:setenv DATA_PUMP_DIR DUMP_FILES1 expdp hr FILE=hrdata.dmp
Oracle Data Pump then uses the served-based directory object
DUMP_FILES1
for thehrdata.dmp
file.If a client-based environment variable
DATA_PUMP_DIR
does not exist, then the process moves to step c. -
If the schema that is running the Oracle Data Pump job has DBA privileges, then the default Oracle Data Pump directory object,
DATA_PUMP_DIR
, is used. This default directory object is established at installation time. For example, the following command causes Oracle Data Pump to attempt to use the defaultDATA_PUMP_DIR
directory object, assuming that system has DBA privileges:expdp system FILE=hrdata.dmp
-
Related Topics
Parent topic: Oracle Data Pump Legacy Mode