Monday, June 29, 2009

Copying only schema definition to another schema

Here is the command to copy only the schema definition from one schema to another schema.

First export the schema definition from user tfr_rep to empty_schema.dmp file

exp tfr_rep/welcome@datagen1-ajaved:1521/tfrdb file=empty_schema.dmp log=export.log rows=n constraints=n owner=tfr_rep

Then copy the dump file to ahsan_tfr user from tfr_rep user as follows.

imp userid=ahsan_tfr/welcome@tfindiadbzone:1521/tfindia file=empty_schema.dmp log=import.log rows=n fromuser=tfr_rep touser=ahsan_tfr

NOTE: Names of tablespaces on both the schema should be same, otherwise import will fail indicating oracle error

Sphere: Related Content