I have a backup of an Oracle 11g database on Linux, that is a version that is 'prescrub' needed by other users. This is for an ACTIVE database that is now scrubbed, so I do not want to use it as the 'active' database for the clone.

I have a second database that is no longer needed, to which I want to overwrite with the 'prescrub' backup of DB1. Can I restore the PRESCRUB backup of DB1 over DB2? If so, what are the appropriate commands or modifications needed?

  • Depends on how the backup was taken. If the backup was taken as a hot inconsistent backup (db was on-line and in archivelog mode), and provided the directory structure is the same between both machines, and provided the control file was part of the RMAN backup, then you just need to RMAN> startup mount; RMAN> catalog start with '<directory of the backup>'; RMAN> restore database; RMAN> recover database; RMAN recover database until scn <the SCN that died for the previous recover command>; RMAN> alter database open resetlogs; – Kris Johnston Feb 26 '16 at 22:20
  • The backup was taken as a COLD backup. Does that make a difference? – MimiFarmer Feb 29 '16 at 1:05
  • The TARGET database current version has the data we need scrubbed out of it, so we need to use the COLD backup of DB1 (TEST) to restore or overwrite DB2 (TRNG). I am told I have to restore DB1 from the old db .. then do a duplicate database via RMAN to DB2? But am getting errors. – MimiFarmer Feb 29 '16 at 1:11
  • Should be the same steps, minus the last 2 recover database steps since there isn't a reason to recover a consistent backup. – Kris Johnston Feb 29 '16 at 14:59

Sure you can, you can duplicate a database using RMAN backups. For example:

  • shut down DB2
  • delete all datafiles, redo logs, controlfiles of DB2
  • start DB2 in NOMOUNT
  • with RMAN, connect to DB1 as target, DB2 as auxiliary:

    rman target sys/password@DB1 auxiliary /
  • duplicate the database until the required time, and rename files on the fly (if required), for example::

    duplicate database to db2
    until time "to_date('2016-02-20 16:00:00', 'YYYY-MM-DD HH24:MI:SS')"
    db_file_name_convert (/oradata/DB1, /oradata/DB2)
    '/oradata/DB2/redo01.log' SIZE 50M,
    '/oradata/DB2/redo02.log' SIZE 50M,
    '/oradata/DB2/redo03.log' SIZE 50M;

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.