RMAN restore versus recover

All posts relating to Oracle database administration.

Moderator: Tim...

RMAN restore versus recover

Postby shrinika » Fri Dec 28, 2012 7:56 pm

Tim, I want to clarify what is RESTORE versus RECOVER. RESTORE is just restore the data files in the appropriate file system. RECOVER will recover the archive log files if any.

I have valid L0 rman backup. Now i want to restore this backup in another server. I do not have any archive log files. I am okay to open the database with resetlog mode.

In this case, do i need to recover the database after the restore?

Here is the steps i followed for restore.

1. startup nomount
2. restore control file
3. mount database
4. restore database
5. open database.

I get the below error when i open the database.

Code: Select all
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/data01/oradata/devdb12/system01.dbf'


Again, i tried to recover as below and opened the database and it is successful.

Code: Select all
RMAN> run
{
allocate channel t1 device type disk format '/data01/stage/%U';
allocate channel t2 device type disk format '/data01/stage/%U';
recover database;
release channel t1;
release channel t2;
}
2> 3> 4> 5> 6> 7> 8>
allocated channel: t1
channel t1: SID=125 device type=DISK

allocated channel: t2
channel t2: SID=9 device type=DISK

Starting recover at 12/28/2012 13:33:23

starting media recovery

unable to find archived log
archived log thread=1 sequence=56
released channel: t1
released channel: t2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/28/2012 13:33:24
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 56 and starting SCN of 1035286

RMAN> exit


Recovery Manager complete.

devdb13*devdb12_dg-/ora/app/oracle/admin
>dba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Dec 28 13:36:22 2012

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database open resetlogs;

Database altered.

SQL>


My question is, why should oracle expect to recover the database when there is no archive log file?

What does oracle do on RECOVER part when there is no archive log file?

I am confused here. Please help me.
shrinika
Advisor
 
Posts: 255
Joined: Fri Jun 13, 2008 3:18 pm

Re: RMAN restore versus recover

Postby Tim... » Fri Dec 28, 2012 11:30 pm

Hi.

RESTORE - Build the fuzzy datafiles from the backup.
RECOVER - Recover the fuzzy datafiles using any incremental backups and archived redo logs, bringing them into a consistent and usable state.

When you perform a hot backup you will always need archived redo logs to recover the database. During a hot backup, the files are copied while they are being amended by the database, so blocks can be inconsistent. The redo logs are necessary to correct these inconsistencies and bring all blocks in all datafiles up to the same point in time.

If you do not plan on keeping archived redo logs, then you have no choice, but to do cold backups.

RMAN has no choice but to ask for the archived redo logs because you have restored fuzzy copies of the datafiles that must be repaired.

Cheers

Tim...
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17935
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK

Re: RMAN restore versus recover

Postby shrinika » Mon Dec 31, 2012 3:45 pm

Tim, Great explanation!! :-)
shrinika
Advisor
 
Posts: 255
Joined: Fri Jun 13, 2008 3:18 pm

Re: RMAN restore versus recover

Postby Tim... » Mon Dec 31, 2012 4:40 pm

:)
Tim...
Oracle ACE Director
Oracle ACE of the Year 2006 - Oracle Magazine Editors Choice Awards
OakTable Member
OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
OCP Advanced PL/SQL Developer
Oracle Database: SQL Certified Expert
My website: http://www.oracle-base.com
My blog: http://www.oracle-base.com/blog
Tim...
Site Admin
 
Posts: 17935
Joined: Mon Nov 01, 2004 5:56 pm
Location: England, UK


Return to Oracle Database Administration

Who is online

Users browsing this forum: No registered users and 6 guests

cron