Problem solve Get help with specific problems with your technologies, process and projects.

Copy data from one schema to a different schema

I want to copy data from one schema to another for testing purposes. The issue is the two schema are not exactly the same.

I want to copy data from one schema (let's call it PROD) to another (let's call it TEST) for testing purposes. I already have these two schemas in the database. The issue is the two schema are not exactly the same: TEST is incomplete regarding PROD. I thought I could do this:
exp userid=xxx/xxx file=my_db.dmp 
log=my_db.log owner=PROD
drop the TEST schema, re-create the TEST user in the DB, then
imp userid=xxx/xxx file=my_db.dmp 
log=imp.log fromuser=PROD touser=TEST
Is it a correct way to do this or is there a simpler way?
The steps you described above are among the simplest. The nice thing about using export/import for this task is that you get an entire copy of the schema. You could use INSERT SELECT statements to copy the data, but then you might miss other schema objects. And INSERT SELECT won't modify the table structure either. Your steps above are how I tackle this task.

Dig Deeper on Oracle database design and architecture