Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Alain.

Asked: August 28, 2017 - 9:49 am UTC

Last updated: August 31, 2017 - 7:52 am UTC

Version: 11.2.0.3

Viewed 1000+ times

You Asked

Hi,

I want to make a simple restore / recovery on a new identical oracle (same os(windows), os version and oracle version) (DRP, oracle 11 or 12). DB is in archivelog mode. I have a rman backup in e:\backup (controlfile autobackup is on), nocatalog (backup info in controlfile), archive logs since backup in e:\archivelog, current redo log, dbid.
=> New hardware is an image of the "original" machine (with oracle database), but a few months older. So folders exist, spfile is unchanged, but controlfile/datafiles/... are old versions. Online logs are in c:\oralogs\online.

=> restore procedure:
copy e:\redolog\*.* c:\oralogs\online /Y

using rman:
set dbid=...
startup nomount;
restore controlfile from 'e:\backup\....';
alter database mount;
catalog start with 'e:\backup\';
catalog start with 'e:\archivelog\';
restore database;
recover database;
alter database open resetlogs;


Seems to work.
Questions:
1. recover database OR recover database using backup controlfile? What is the difference between the statements as controlfile has to be there before starting recovery?
2. alter database open doesn't work, it seems open resetlogs is always needed. I am not sure the content of the current redo log is applied. Is it or not? If not, how to apply it?


Regards.

and Connor said...

I'm confused - an RMAN backup does not contain the redo logs so I'm wondering why you have them.

But here's the typical scenarios

1) The backup was a cold backup, and you want a copy of it

You restore the database, no media recovery will be required. You open the database resetlogs to instantiate fresh redo logs on the target

2) The backup was a cold backup, and you want a copy of it and then roll forward with archives to a known point from the primary that occurred after the cold backup

You restore the database and controlfile, issue 'recover until' (scn/time/etc) and it will pick up the archives you cataloged. You open the database resetlogs to instantiate fresh redo logs on the target

3) The backup was a hot backup and you want to roll forward as far as you can

You restore the database and controlfile, issue 'recover until' (scn/time/etc) using backup controlfile, and it will pick up the archives you cataloged. You open the database resetlogs to instantiate fresh redo logs on the target



"recover database OR recover database using backup controlfile? What is the difference between the statements as controlfile has to be there before starting recovery?"


1. Anytime the controlfile is older than any of your datafiles.
2. You do not have a valid current control file. (It is either missing or corrupt.)

Don't forget, a *normal* restore/recover is when you *have* the current control file, so the database will use the contents of the controlfile to determine recovery requirements. If you're control file is not current, then 'using backup controlfile' tells the database that we can't rely on its contents.

" alter database open doesn't work, it seems open resetlogs is always needed. "


See above. If it was a cold backup, there are not outstanding changes in the redo log. If it was a hot backup, rolling through the archive log will pick up the changes.

Rating

  (1 rating)

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

Comments

just "open"

Alain Bourgeois, August 29, 2017 - 6:27 am UTC

1. "an RMAN backup does not contain the redo logs so I'm wondering why you have them. "=> redo logs can be on the storage box, it can be that server is down but storage box is fine.

2. if I understand correctly, if I do restore controlfile from '...' then restore database, the controlfile will always be current against datafiles, and I will never have to type "using backup controlfile" in this case?

3. if I understand correctly, in the case of a hot backup, it is ALWAYS an open resetlogs and the content of the current redo log is always lost?
Connor McDonald
August 31, 2017 - 7:52 am UTC

1) yes, but you would not *use* them (assuming a cold backup)

2) possibly but unlikely. Normally during recovery (same box) you would *not* restore the control file. You restore the datafiles and recovery them *based* on the information in the controlfile which is up to date. Backup/recovery is based on the premise that its very very rare to lose *all* of your control files.

3) See (2). If you've *lost* your control files, then yes. If not, then no.

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database