2

I want to clone oracle databases on the same machine and I need to change user etc. from e.g. PROD to DEV. For that I use expdp/impdp, but this tends to be slow with increasing database size. I need to do this on linux and windows machines.

Is using expdp/impdp the fastest way to do this?

Or should I use a completly different way of doing this?

migrated from stackoverflow.com Oct 5 '14 at 3:54

This question came from our site for professional and enthusiast programmers.

1

rman is the tool for this.

https://docs.oracle.com/cd/E11882_01/backup.112/e10642/toc.htm

There is a learning curve, but once configured, it's much faster than export/import.

1

Like @djb mentioned RMAN is the safest bet, but at times it won't be the fastest solution.

There are other ways, copying database manually comes to mind. It definitely isn't the easiest way and won't be usable if You can't put source database offline for some time.

Pros:

  • might be faster than RMAN Duplicate - it depends how much time has passed since your last full backup - each archive log file to append adds time to process
  • doesn't require You to use RMAN - I don't know any reason You wouldn't want to learn it, as Oracle db admin, at some point though.
  • allows You to change more settings in the process.

Cons:

  • requires cold copy of source database - downtime will be longer when making copies
  • harder, prone to manual errors - like with all other hand work - You can script at least some parts of it though.

I had some strange issues with 10g2 Standard and RMAN, while duplicating database between two completely different configured Linux servers, without any issues with restoring one database on another existing one. This solution allowed me to make fast copies of production database.

In the process, after copying data files, You will have to edit initdb.ora file, ensuring all the path changes. Followed by starting new instance in mount mode and changing name with DBNEWID utility (and changing it in initdb.ora file).

In some cases You could combine both solutions - by making a copy of database with empty data files and restoring source database to copy with RMAN - but with properly configured servers RMAN duplicate will be faster and easier.

Don't know if it is as straightforward or even possible with ASM under Oracle.

You can find more details about duplicating database manually over there:

http://www.dbaref.com/clone-oracle-database/howtocloneadatabasemanuallywithoutusingrman

http://www.dba-oracle.com/oracle_tips_db_copy.htm

  • 1
    @Colin'tHart : Added more information about how whole process looks and what are (imho) pros and cons over RMAN duplicating. It still depends on links, but I'd like to be it that way - complete answer depends on configuration and is beyond my abilities atm and I would like to mention places that did teach me about manual copying. – Marcin S. Jul 1 '16 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.