Sunday, September 21, 2008

REMAP_TABLESPACE

Purpose

Remaps all objects selected for import with persistent data in the source tablespace to be created in the target tablespace.


Syntax and Description
REMAP_TABLESPACE=source_tablespace:target_tablespace

Multiple REMAP_TABLESPACE parameters can be specified, but no two can have the same source tablespace. The target schema must have sufficient quota in the target tablespace.

Note that use of the REMAP_TABLESPACE parameter is the only way to remap a tablespace in Data Pump Import. This is a simpler and cleaner method than the one provided in the original Import utility. In original Import, if you wanted to change the default tablespace for a user, you had to perform several steps, including exporting and dropping the user, creating the user in the new tablespace, and importing the user from the dump file. That method was subject to many restrictions (including the number of tablespace subclauses) which sometimes resulted in the failure of some DDL commands.

By contrast, the Data Pump Import method of using the REMAP_TABLESPACE parameter works for all objects, including the user, and it works regardless of how many tablespace subclauses are in the DDL statement.


Example

The following is an example of using the REMAP_TABLESPACE parameter.

> impdp hr/hr REMAP_TABLESPACE='tbs_1':'tbs_6' DIRECTORY=dpump_dir1 PARALLEL=2
JOB_NAME=cf1n02 DUMPFILE=employees.dmp NOLOGFILE=Y

No comments: