In our cloning procedures we use the RMAN “DUPLICATE” command for duplicating databases. This all went fine for a long time until one moment we start getting errors during the duplication process (from the point where media recovery gets started). Here is an example of the errors we received:
RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 01/07/2013 13:52:31 RMAN-05501: aborting duplication of target database RMAN-03015: error occurred in stored script Memory Script ORA-19870: error while restoring backup piece oanupn5l_1_1 ORA-19809: limit exceeded for recovery files ORA-19804: cannot reclaim 15728640 bytes disk space from 5218762752 limit RMAN>
RMAN fails while it is trying to restore archivelogs that will be used for media recovery. It tells you that there is not enough space in the FRA (of the auxiliary database) to restore the archivelogs, even when the FRA for the auxiliary database is totally empty. The problem is due to a bug which makes RMAN to take the FRA usage (ignoring the value of reclaimable space) of the target database and compare that to FRA size of the auxiliary database.
If you cannot have the same FRA size for the auxiliary database as the target database, then the workaround we use to “solve” this problem with cloning databases, is to just increase the size of the FRA (parameter db_recovery_file_dest_size) on the auxiliary database to be bigger than the used space (including reclaimable space!) of the FRA for the target database.
If you don’t have enough physical disk space available for the FRA for the auxiliary database then you can just temporarily increase the db_recovery_file_dest_size parameter to a value that’s bigger than the physical available space. It is just to make RMAN happy when it checks the FRA usage and it will proceed with the media recovery. After you have finished the clone you can resize the db_recovery_file_dest_size parameter again to its original value.
This bug is registered by Oracle support as Bug 13741583 – RMAN duplication erroneously fails with ORA-19804 using fast recovery area [ID 13741583.8].
It seems a patch has currently been made available for 22.214.171.124 databases running on Solaris SPARC (64 bit) and Linux x86-64 (Patch 13741583: RMAN DUPLICATION ERRONEOUSLY FAILS WITH ORA-19804).