Dreamer
Dreamer

Reputation: 7551

What is the best way to copy a database schema to a different schema in Oracle

I am looking for the most efficient way to copy an Oracle database schema to a new schema on different tablespace.

This is what I have tried:

  1. Export the current instance by expdp
  2. Import the instance by using impdp with REMAP_SCHEMA and REMAP_TABLESPACE attributes.

Is this the best way to achieve the goal? I am on Oracle 11g.

Upvotes: 1

Views: 10749

Answers (1)

Endrik
Endrik

Reputation: 2258

If by best you mean the simplest way, i would also suggest you using the Copy function inside SQL Developer Tool. You can watch this video to get an example: SQL Developer - Database Copy.
In practice, all you must do is, create another schema which would be used as your target one, create a connection with that schema and use the tool. It has various options which let you select what kind of objects and other stuff to do. Of course, the target schema which you are creating should be on the tablespace you want. This way you are not creating and moving any files, and the tool will provide you with a script used to make the copy, which you can save for later.

Upvotes: 2

Related Questions