Backup with exp and imp

Although best practice is to use RMAN, Oracle’s backup utility, you can also use imp and exp export and import a schema in Oracle. Here are the command lines:

 

exp oware/dorado owner=oware file=<backup filename>.dmp

 

exp exports a proprietary binary database backup. The above command line essentially says “export the objects owned by oware.”

You can then import that database backup using imp:

 

imp oware/dorado fromuser=oware touser=oware file=<backup filename>.dmp

 

Since the backup file contains both object creation and the data contained in those objects, you must have an empty schema (no objects) to import the schema, without error. Use the ignore=y flag to ignore object creation errors. One suggested option is to run loaddb -e followed by the following import command to restore:

 

imp oware/dorado fromuser=oware touser=oware ignore=y file=<backup

filename>.dmp

 

[spacer]

There is no substitute for having a DBA.