Skip to Main Content
  • Questions
  • Getting RMAN-05502 when trying to duplicate from backup

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Dean.

Asked: May 06, 2016 - 5:10 pm UTC

Last updated: October 21, 2017 - 1:15 am UTC

Version: 11.2.0.3.0

Viewed 10K+ times! This question is

You Asked

I have very little experience with Oracle. We are a SQL Server shop with one legacy Oracle 11.2 database that serves an obscure but critical function. As part of our testing routine, this database needs to be copied from our production instance into several test instances. We do this by duplicating the test database using RMAN, from backup.

I just follow a series of steps left to us by the previous (Oracle) DBA when he left.

shutdown <testdb>
startup nomount

rman auxiliary /

connect target <testdb>

I then run an RMAN script that looks like this (I have to set the database names, until time, logfile locations:

run{
ALLOCATE AUXILIARY CHANNEL newdb DEVICE TYPE disk;
DUPLICATE TARGET DATABASE TO <test db>
DB_FILE_NAME_CONVERT ('<prod db>','<test db>')
UNTIL TIME "TO_DATE('2016-05-05 07:30:00', 'YYYY-MM-DD HH24:MI:SS')"
LOGFILE
GROUP 1 ('D:\oralogs\<testdb>\redo01.log') SIZE 100M REUSE,
GROUP 2 ('D:\Oralogs\<testdb>\redo02.log') SIZE 100M REUSE,
GROUP 3 ('D:\oralogs\<testdb>\redo03.log') SIZE 100M REUSE,
GROUP 4 ('D:\oralogs\<testdb>\redo04.log') SIZE 100M REUSE,
GROUP 5 ('D:\oralogs\<testdb>\redo05.log') SIZE 100M REUSE
BACKUP LOCATION '\\backup network location';
}

At this point I get an error that I cannot figure out.

RMAN-05502: the target database must be mounted when issuing a DUPLICATE command

I have searched online for hours - this error points to the target database not being mounted. However, I am duplicating from backup. I've been through the online RMAN documentation pretty carefully, and I cannot see why this is failing.

My colleague usually performs this procedure, so as far as I know this usually works. However she is quite ill right now.

and Connor said...

I know the names are awful, but in this case

the "target" is the source (ie, production)
the "auxiliary" is the target (ie, test)

So for duplicate from prod => test, it will be:

connect target <prod>
connect auxiliary <test>
duplicate target database to ...

Hope this helps.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Wrong Answer

Sandeep Singh, October 20, 2017 - 6:01 pm UTC

Please check "RMAN 11GR2 : DUPLICATE Without Target And Recovery Catalog Connection (Doc ID 874352.1)"

If you dont want to connect to Target at all. You want to duplicate from a RMAN backup in other server. Why you want to connect to target ???

Either answer is wrong or Doc ID 874352.1 is wrong or BOTH.
Connor McDonald
October 21, 2017 - 1:15 am UTC

My mistake - I didnt read the original script carefully enough. I was assuming duplicate from active.

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.