Database Reference
In-Depth Information
â–  to generate transportable tablespaces, you must use the Oracle enterprise edition. You can use other editions
of Oracle to import transportable tablespaces.
Note
Features for Manipulating Storage
Data Pump contains many flexible features for manipulating tablespaces and data files when exporting and importing.
The following sections show useful Data Pump techniques when working with these important database objects.
Exporting Tablespace Metadata
Sometimes, you may be required to replicate an environment—say, replicating a production environment into a
testing environment. One of the first tasks is to replicate the tablespaces. To this end, you can use Data Pump to pull
out just the DDL required to recreate the tablespaces for an environment:
$ expdp mv_maint/foo directory=dp_dir dumpfile=inv.dmp \
full=y include=tablespace
The FULL parameter instructs Data Pump to export everything in the database. However, when used with
INCLUDE , Data Pump exports only the objects specified with that command. In this combination only metadata
regarding tablespaces are exported; no data within the data files are included with the export. You could add the
parameter and value of CONTENT=METADATA_ONLY to the INCLUDE command, but this would be redundant.
Now, you can use the SQLFILE parameter to view the DDL associated with the tablespaces that were exported:
$ impdp mv_maint/foo directory=dp_dir dumpfile=inv.dmp sqlfile=tbsp.sql
When you use the SQLFILE parameter, nothing is imported. In this example the prior command only creates a
file named tbsp.sql , containing SQL statements pertaining to tablespaces. You can modify the DDL and run it in the
destination database environment; or, if nothing needs to change, you can directly use the dump file by importing
tablespaces into the destination database.
Specifying Different Data File Paths and Names
As previously discussed, you can use the combination of the FULL and INCLUDE parameters to export only tablespace
metadata information:
$ expdp mv_maint/foo directory=dp_dir dumpfile=inv.dmp \
full=y include=tablespace
What happens if you want to use the dump file to create tablespaces on a separate database server that has
different directory structures? Data Pump allows you to change the data file directory paths and file names in the
import step with the REMAP_DATAFILE parameter.
 
 
Search WWH ::




Custom Search