Database Reference
In-Depth Information
For example, say the source data files existed on a mount point named /ora03 , but on the database being
imported to, the mount points are named with /ora01 . Here is a parameter file that specifies that only tablespaces
beginning with the string INV should be imported and that their corresponding data files names be changed to reflect
the new environment:
userid=mv_maint/foo
directory=dp_dir
dumpfile=inv.dmp
full=y
include=tablespace:"like 'INV%'"
remap_datafile="'/ora03/dbfile/O12C/inv_data01.dbf':'/ora01/dbfile/O12C/tb1.dbf'"
remap_datafile="'/ora03/dbfile/O12C/inv_index01.dbf':'/ora01/dbfile/O12C/tb2.dbf'"
When Data Pump creates the tablespaces, for any paths that match the first part of the string (to the left of the
colon [ : ]), the string is replaced with the text in the next part of the string (to the right of the colon).
When working with parameters that require both single and double quotation marks, you'll get predictable
behavior when using a parameter file. In contrast, if you were to try to enter in the various required quotation marks on
the command line, the OS may interpret and pass to Data pump something other than what you were expecting.
Tip
Importing into a Tablespace Different from the Original
You may occasionally be required to export a table and then import it into a different user and a different tablespace.
The source database could be different from the destination database, or you could simply be trying to move data
between two users within the same database. You can easily handle this requirement with the REMAP_SCHEMA and
REMAP_TABLESPACE parameters.
This example remaps the user as well as the tablespace. The original user and tablespaces are HEERA and
INV_DATA . This command imports the INV table into the CHAYA user and the DIM_DATA tablespace:
$ impdp mv_maint/foo directory=dp_dir dumpfile=inv.dmp remap_schema=HEERA:CHAYA \
remap_tablespace=INV_DATA:DIM_DATA tables=heera.inv
The REMAP_TABLESPACE feature doesn't recreate tablespaces. It only instructs Data Pump to place objects in
tablespaces different from those they were exported from. When importing, if the tablespace that you're placing the
object in doesn't exist, Data Pump throws an error.
Changing the Size of Data Files
You can change the size of the data files when importing by using the TRANSFORM parameter with the PCTSPACE option.
Say you've created an export of just the tablespace metadata:
$ expdp mv_maint/foo directory=dp_dir dumpfile=inv.dmp full=y include=tablespace
Now, you want to create the tablespaces that contain the string DATA in the tablespace name in a development
database, but you don't have enough disk space to create the tablespaces as they were in the source database. In
this scenario, you can use the TRANSFORM parameter to specify that the tablespaces be created as a percentage of the
original size.
 
 
Search WWH ::




Custom Search