Issue:
While I was restoring a Non-Production DB using the duplicate method from RMAN backup, I received this error:
RMAN-05502: the target database must be mounted when issuing a DUPLICATE command
Here is the RMAN script I was using:
run {
ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL ch2 DEVICE TYPE DISK;
duplicate database to "pssp" backup location '/db02/bkp/2019-06-02' nofilenamecheck
UNTIL TIME "TO_DATE('01/06/2019 13:05:17', 'DD/MM/YYYY HH24:MI:SS')";
}
I used to run the duplicate command first time with random UNTIL TIME date ahead of the backup date, then the RMAN will give me an error indicating the actual farthest recovery date the backup can go to, then I use this date from the error message and update the UNTIL TIME with it in the duplicate script, and run it one more time.
Solution:
I found that I used a date older than the backup date in the duplicate script, this is why I got that vague error message. Once I used a date ahead of the backup time (randomly) I got the right farthest recovery date the backup can go to:
run {
ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL ch2 DEVICE TYPE DISK;
duplicate database to "pssp" backup location '/db02/bkp/2019-06-02' nofilenamecheck
UNTIL TIME "TO_DATE('20/06/2019 13:05:17', 'DD/MM/YYYY HH24:MI:SS')";
}
RMAN-06617: UNTIL TIME (20-Jun-2019 13:05:17) is ahead of last NEXT TIME in archived logs (02-Jun-2019 17:30:19)
Then I restarted the instance in NOMOUNT mode and used the exact "last NEXT TIME in archived logs" date mentioned in the last RMAN error message in the script, and the duplicate succeeded.
run {
ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL ch2 DEVICE TYPE DISK;
duplicate database to "pssp" backup location '/db02/bkp/2019-06-02' nofilenamecheck
UNTIL TIME "TO_DATE('02/06/2019 17:30:19', 'DD/MM/YYYY HH24:MI:SS')";
}
While I was restoring a Non-Production DB using the duplicate method from RMAN backup, I received this error:
RMAN-05502: the target database must be mounted when issuing a DUPLICATE command
Here is the RMAN script I was using:
run {
ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL ch2 DEVICE TYPE DISK;
duplicate database to "pssp" backup location '/db02/bkp/2019-06-02' nofilenamecheck
UNTIL TIME "TO_DATE('01/06/2019 13:05:17', 'DD/MM/YYYY HH24:MI:SS')";
}
I used to run the duplicate command first time with random UNTIL TIME date ahead of the backup date, then the RMAN will give me an error indicating the actual farthest recovery date the backup can go to, then I use this date from the error message and update the UNTIL TIME with it in the duplicate script, and run it one more time.
Solution:
I found that I used a date older than the backup date in the duplicate script, this is why I got that vague error message. Once I used a date ahead of the backup time (randomly) I got the right farthest recovery date the backup can go to:
run {
ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL ch2 DEVICE TYPE DISK;
duplicate database to "pssp" backup location '/db02/bkp/2019-06-02' nofilenamecheck
UNTIL TIME "TO_DATE('20/06/2019 13:05:17', 'DD/MM/YYYY HH24:MI:SS')";
}
RMAN-06617: UNTIL TIME (20-Jun-2019 13:05:17) is ahead of last NEXT TIME in archived logs (02-Jun-2019 17:30:19)
Then I restarted the instance in NOMOUNT mode and used the exact "last NEXT TIME in archived logs" date mentioned in the last RMAN error message in the script, and the duplicate succeeded.
run {
ALLOCATE AUXILIARY CHANNEL ch1 DEVICE TYPE DISK;
ALLOCATE AUXILIARY CHANNEL ch2 DEVICE TYPE DISK;
duplicate database to "pssp" backup location '/db02/bkp/2019-06-02' nofilenamecheck
UNTIL TIME "TO_DATE('02/06/2019 17:30:19', 'DD/MM/YYYY HH24:MI:SS')";
}