ADP - Analyse, Design & Programmierung GmbH | |
René Nyffenegger on Oracle - Most wanted - Feedback |
exp and imp in Oracle |
||
exp and imp are the executables that allow to
make exports and imports of data objects (such as tables).
exp/imp allow to transfer the data accross databases that
reside on different hardware plattforms and/or on different Oracle
versions. If the data is exported on a system with a different Oracle
version then on that on which it is imported, imp must be the newer
version. That means, if something needs to be exported from 10g into 9i,
it must be exported with 9i's exp.
imp doesn't re-create an already existing table. It either
errors out or ignores the errors.
In order to use exp and imp, the catexp.sql script
must be run. catexp.sql basically creates the exp_full_database and
imp_full_database roles.
It is found under $ORACLE_HOME/rdbms/admin:
SQL> @?/rdbms/admin/catexp catexp is called by catalog.sql.
Import export modesexp/imp can be used in four modes:
Full exportThe EXP_FULL_DATABASE
and IMP_FULL_DATABASE,
respectively, are needed to perform a full export.
Use the full
export parameter for a full export.
TablespaceUse the tablespaces
export parameter for a tablespace export.
UserThis mode can be used to export and import all objects that
belong to a user.
TableSpecific tables (and partitions) can be exported/imported
with table export mode.
Use the tables
export parameter for a table export.
expObjects owned by SYS
cannot be exported.
PrerequisitesOne must have the create session privilege
for being able to use exp. If objects of another user's schema need to be
exported, the EXP_FULL_DATABASE
role is required.
ParametersfullUse this parameter to specify full
export mode.
tablespacesUse this parameter to specify tablespace
export mode.
ownerUse this parameter to specify user
export mode.
tablesUse this parameter to specify table
export mode.
directUsed for a direct path export.
feedback=nPrints a dot after each nth exported row.
flashback_scnThe exported data is consistent with the specified SCN.
flashback_timeThe exported data is consistent with a SCN that
approximately matches that of the specified time.
consistentobject_consistentqueryRestricts the exported rows by means of a where
clause.
The query parameter can only be used for table
export mode. For obvious reasons, it must be appliable to all exported
tables.
parfileSpecifies a parfile.
NLS_LANG settingsAs exp and imp are client utilities they use the NLS_LANG
settings.
See also nls_language.
impIf the parameter touser is used and (?) the export
was made with FULL=YES, the users must already be created in the
target database.
ParametersshowThis parameter only shows the contents of an export file;
it does not perform an import.
fromuserThis parameter is used when an import in 'user
export/import mode is made.
Using imp/exp accross different Oracle versionsIf exp and imp are used to export data from an Oracle
database with a different version than the database in which is imported,
then the following rules apply:
Transportable tablespacesThe parfileA parfile (=parameter file) contains a list of export
parameters. |