rman restore from full backupset

My question is how, or can, I restore a database to another host if given only a full backup from say the 14th?

When I run restore it fails looking for some files, error:

archive log thread 1 sequence 5178 is already on disk as file /u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_20/o1_mf_1_5178_519n6p2s_.arc
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=5930
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=5931
channel ORA_DISK_1: reading from backup piece /u02/oradata/flash_recovery_area/flash_recovery_area/APPN/backupset/2009_05_15/o1_mf_annnn_TAG20090515T003046_50svzs4f_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/u02/oradata/flash_recovery_area/flash_recovery_area/APPN/backupset/2009_05_15/o1_mf_annnn_TAG20090515T003046_50svzs4f_.bkp tag=TAG20090515T003046
channel ORA_DISK_1: restore complete, elapsed time: 00:02:38
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_21/o1_mf_2_5930_51b06gp0_.arc thread=2 sequence=5930
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_20/o1_mf_1_5178_519n6p2s_.arc thread=1 sequence=5178
channel default: deleting archive log(s)
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_21/o1_mf_2_5930_51b06gp0_.arc recid=17338 stamp=687410571
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_21/o1_mf_2_5931_51b0bcvy_.arc thread=2 sequence=5931
channel default: deleting archive log(s)
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_21/o1_mf_2_5931_51b0bcvy_.arc recid=17339 stamp=687410592
unable to find archive log
archive log thread=2 sequence=5932
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/21/2009 03:26:48
RMAN-06054: media recovery requesting unknown log: thread 2 seq 5932 lowscn 1070524268


I connect to rman target / and have tried running the following scripts run:
run{ set until sequence 5931;
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
}

I tried running without specifying "set until" hoping rman was smart enough to restore to the last available scn in the backup sets but it failed as it tried to roll to the current date.

I tried running specifying a "set until" time that was in the middle of the time frame the backsets where written to disk but this failed as well.


geodinAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tangchunfengCommented:
1.restore archive log from seq 5931

run {
allocate channel choo type 'SBT_TYPE';
send 'NB_ORA_SERV=svr1,NB_ORA_CLIENT=new_host';
restore archivelog from logseq 5931
}

2. recover database until cancel

RMAN > recover database until cancel using backup controlfile;

3. open db with resetlog

RMAN > alter database open resetlogs;


0
geodinAuthor Commented:
Thanks, I will try that once my current restore completes/fails out again.

But I am curious about how to restore with just a backupset and no prod server to locate SCN, log sequence, etc. and if there are no archive logs on tape. Shouldn't a full backupset have everything needed to recover?
0
mrjoltcolaCommented:
You did not mention, but by the looks of it, this is a RAC instance? It is applying multiple redo threads.

The problem is you are only specifying "UNTIL SEQUENCE" with no thread, so it assumed thread 1. Thread 1 / Sequence 5932 does not exist. Thread 2 / sequence 5932 probably DOES, but that is not what the UNTIL clause says. So if you notice, the thread 1 sequences are much lower than thread 2. How have you identified 5931 as the sequence you need?

Try:

SET UNTIL SEQUENCE 5931 THREAD 2;

Or SEQUENCE xxx THREAD 1 where xxx is whatever makes sense for thread 1.

Try recovering until SCN or TIME, (which you said you already tried, but you did not include a log for).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

geodinAuthor Commented:
I have run:

run{ set until time "to_date('2009-05-13 23:59:59','YYYY-MM-DD HH24:MI:SS')";
restore database;
switch datafile all;
recover database;
alter database open resetlogs;
}

Whichs seems to have run well until it got to the open resetlogs, rman output:

channel default: deleting archive log(s)
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_21/o1_mf_2_5916_51bxjzt6_.arc recid=17343 stamp=687440609
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_21/o1_mf_2_5917_51bxom68_.arc thread=2 sequence=5917
channel default: deleting archive log(s)
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_21/o1_mf_1_5173_51bxoos8_.arc recid=17354 stamp=687440702
channel default: deleting archive log(s)
archive log filename=/u02/oradata/flash_recovery_area/APPN/archivelog/2009_05_21/o1_mf_2_5917_51bxom68_.arc recid=17355 stamp=687440711
media recovery complete, elapsed time: 00:28:18
Finished recover at May 21 2009 12:14:04

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 05/21/2009 12:14:06
ORA-00344: unable to re-create online log '/u02/oradata/appn/log01/redo01_01.log'
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory

RMAN> **end-of-file**


What can I do from here?

Thanks,
Geodin
0
mrjoltcolaCommented:
Does the directory /u02/oradata/appn/log01/  exist and is it writable?

Resetlogs is trying to recreate the redo logs in their original paths.

0
mrjoltcolaCommented:
Why are you using:   switch datafile all;

Did you rename datafiles? If so, I don't see it in your RMAN recovery script.
0
geodinAuthor Commented:
That was it, the log<n> directory did not exist. I created them then reran the alter database open resetlogs; and the database is up and open. THANKS!

I am just having users verify before I close this question.

Doing a little research I guess I didn't need the switch datafile statement, more for restoring from a different incarnation. I'll take that out if I need to perform this again.

Thanks,
Geodin
0
mrjoltcolaCommented:
Great, glad to help! Always good to see the database open. :)

Yes, the RMAN switch command switches the current controlfile over to the "new" paths, but I would not include it
because it can affect the RMAN catalog when used, though in this case I would assume it has no-effect, you never know.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.