Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

restore database from an old incarnation

2,360 views
Skip to first unread message

Anthony

unread,
Feb 17, 2009, 11:39:56 PM2/17/09
to
Hi,

We are using rman and a 3rd party vendor backing up to tape directly.
We used Oracle 10g2 on windows 2003 server with a catalog database on
another database.

I need to restore and recover a database from a previous incarnation
to a different server. (NOT the original production). I create a new
instance on the new box. I tried to recover the control file first but
get following error.

RMAN> run {
2> allocate channel ch1 type 'sbt_tape'
3> PARMS="BLKSIZE=262144,ENV=(CvClientName=svr-lms-
db2,CvInstanceName=In
stance001)";
4> restore controlfile until time = "TO_DATE('10/04/2008
04:29:27','MM/DD/YYYY
HH24:MI:SS')" ;
5> }

allocated channel: ch1
channel ch1: sid=157 devtype=SBT_TAPE
channel ch1: CommVault Systems for Oracle: Version 7.0.0(BUILD76)

Starting restore at 17-FEB-09
released channel: ch1
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================
RMAN-03002: failure of restore command at 02/17/2009 20:37:43
RMAN-06004: ORACLE error from recovery catalog database: RMAN-20207:
UNTIL TIME
or RECOVERY WINDOW is before RESETLOGS time


How do I go back to a previous incarnation? Please remember I am not
recovering and restoring the original database. I just want to get
back a database four months ago for comparison.

Thanks for any help.

matthi...@gmail.com

unread,
Feb 18, 2009, 5:28:41 AM2/18/09
to

Cause: UNTIL TIME and RECOVERY WINDOW cannot be less than
the database creation time or RESETLOGS time.

Action: Check the UNTIL TIME or RECOVERY WINDOW. If the
database needs to be restored to an old incarnation, use the
RESET DATABASE TO INCARNATION command.


Matthias

Mladen Gogala

unread,
Feb 18, 2009, 9:28:12 AM2/18/09
to

You should restore the control file, list the available incarnations,
reset the incarnation to the appropriate value and restore it. Here is
how to find out the incarnation:

[oracle@oracle16 ~]$ rman target /

Recovery Manager: Release 10.2.0.4.0 - Production on Wed Feb 18 09:12:31
2009

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

connected to target database: ADPRD (DBID=3026642841)

RMAN> list incarnation;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ADPRD 3026642841 PARENT 30961751778 13-FEB-07
2 2 ADPRD 3026642841 CURRENT 49843664666 21-SEP-07

RMAN>

This is a development database that has been restored from production.

When you know the incarnation of your database that you want to restore
to, you should reset it to the required incarnation using
RESET DATABASE TO INCARNATION <inc Key>;

That is a RMAN command, described in the backup ref. manual. As a matter
of fact, the example from the manual is more complete than mine. Here it
is:

STARTUP NOMOUNT;
RESTORE CONTROLFILE UNTIL TIME 'SYSDATE-250';
ALTER DATABASE MOUNT;

# step 2: obtain the primary key of old incarnation
LIST INCARNATION OF DATABASE trgt;

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ------------- ------- ---------- ----------
1 2 TRGT 1334358386 PARENT 154381 OCT 30 2001
16:02:12
1 116 TRGT 1334358386 CURRENT 154877 OCT 30 2001
16:37:39

# step 3: in this example, reset database to incarnation key 2
RESET DATABASE TO INCARNATION 2;

# step 4: restore and recover the database to a point before the RESETLOGS
RESTORE DATABASE UNTIL SCN 154876;
RECOVER DATABASE UNTIL SCN 154876;
.....

For the rest, I can only advise you take a look into the documentation,
available on OTN.

--
http://mgogala.freehostia.com

0 new messages