Home » RDBMS Server » Backup & Recovery » RMAN - Incarnation
RMAN - Incarnation [message #74775] Mon, 14 February 2005 17:02 Go to next message
devika
Messages: 21
Registered: November 2004
Junior Member
I had taken backup twice say backup1 and after few transactions backup2. After incomplete recovery to data available in backup1, i had to reset the database to new incarnation. Now i want to reset my database to the old incarnation and restore my database to what is available in backup2. Is this possible through RMAN ?? I have tried it with OS commands but could not do it thru RMAN.
Kindly let me know if this possible and how ??
Thankin u,
Re: RMAN - Incarnation [message #74780 is a reply to message #74775] Tue, 15 February 2005 01:52 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>>I have tried it with OS commands but could not do it thru RMAN.
I dont understand this.
Database incarnation is something to do internally with RMAN.
what OS commands would help you this?
The following snippet from docs will help you.
To avoid your situation ( resetting the incarnation, though it can be done easily) i always maintain them in different RMAN catalog users.
for example, always backup is done by RMAN user A.
for restore i another rman users B and C ( just in case like this, if B is used for restoration and sees only the new incarnation, Still C can see the old information)

To reset the recovery catalog to an older incarnation:

   1. Specify the primary key of the desired database incarnation. Obtain the incarnation key value by issuing a LIST command:

LIST INCARNATION;

List of Database Incarnations
DB Key  Inc Key   DB Name   DB ID       CUR    Reset SCN    Reset Time
------- -------   -------   ------      ---    ----------   ----------
1       2         TRGT      1224038686  NO     1            02-JUL-01
1       582       TRGT      1224038686  YES    59727        10-JUL-01

   2. Reset the database to the old incarnation. For example, enter:

RESET DATABASE TO INCARNATION 2;

   3. Shut down the database and start it without mounting. For example:

SHUTDOWN IMMEDIATE
STARTUP NOMOUNT

   4. Restore a control file from the old incarnation.
 If you have a control file tagged, then specify the 
tag. Otherwise, you can run the SET UNTIL command, as 
in this example:

RUN 
{
  SET UNTIL 'SYSDATE-45';
  RESTORE CONTROLFILE;
}

   5. Mount the restored control file:

ALTER DATABASE MOUNT;

   6. Run RESTORE and RECOVER commands to restore and 
recover the database files from the prior incarnation, 
then open the database with the RESETLOGS option. For 
example, enter:

RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;

Re: RMAN - Incarnation [message #74782 is a reply to message #74780] Tue, 15 February 2005 02:13 Go to previous messageGo to next message
devika
Messages: 21
Registered: November 2004
Junior Member
Thanks a lot Mahesh !! I will get back to u after trying this out for my database.
Re: RMAN - Incarnation [message #74784 is a reply to message #74780] Tue, 15 February 2005 19:48 Go to previous messageGo to next message
devika
Messages: 21
Registered: November 2004
Junior Member
Hello Mahesh,
I followed the steps which u gave. I was able to restore the database but could not recover the database. This is what i got :

channel c1: restore complete
Finished restore at 16-FEB-05

Starting recover at 16-FEB-05

starting media recovery

unable to find archive log
archive log thread=1 sequence=5
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/16/2005 08:37:05
RMAN-06054: media recovery requesting unknown log: thread 1 scn 1003247

Should i include the archive log files when ever i take backup ???? Kindly help !!

What i meant by OS commands was that i had taken backup1 and backup2 and placed it in different disks.!!!

Thanking u!!!
Re: RMAN - Incarnation [message #74785 is a reply to message #74784] Tue, 15 February 2005 19:59 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
OFcourse yes.
You need archived logs for incomplete recovery.
Re: RMAN - Incarnation [message #74786 is a reply to message #74785] Tue, 15 February 2005 20:24 Go to previous messageGo to next message
devika
Messages: 21
Registered: November 2004
Junior Member
backup database archivelog - Is this the command that i sould give when taking backup1 and also backup2 ???
Re: RMAN - Incarnation [message #74787 is a reply to message #74786] Wed, 16 February 2005 01:17 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Please read the documentation

To back up archived redo logs using BACKUP ... PLUS ARCHIVELOG:

1. Ensure that the database is mounted or open.
2. After starting RMAN, run the BACKUP command at the RMAN prompt and specify PLUS ARCHIVELOG. This example backs up the database and all archived redo logs:

BACKUP DATABASE PLUS ARCHIVELOG;

3. Issue a LIST BACKUP command to see a listing of backup sets and pieces. For example:

LIST BACKUP OF DATABASE SUMMARY;
LIST BACKUP OF ARCHIVELOG SUMMARY;
Re: URGENT ! RMAN - Incarnation [message #74791 is a reply to message #74787] Wed, 16 February 2005 23:02 Go to previous messageGo to next message
devika
Messages: 21
Registered: November 2004
Junior Member
Hello Mahesh,
Kindly go through this and help me out to solve this !! Sorry for the inconvenience

BACkup1 taken
table dropped
backup2 taken

1) Startup mount
2) set until seq 9 thread 1;
3) resotre database
4) recover database
5) alter databae open resetlogs;

At this point, i could get the dropped table. Exported it and stored it as a dump file .Now i want to get my database to the state when backup2 was taken . This is what i have tried :



reset database to <old incarnation no>
shutdown immediate

RMAN> startup nomount;

Oracle instance started

Total System Global Area 537989600 bytes

Fixed Size 451040 bytes
Variable Size 469762048 bytes
Database Buffers 67108864 bytes
Redo Buffers 667648 bytes

RMAN> run
2> { allocate channel c1 type disk;
3> set until scn 1046162;
4> restore controlfile;
5> }

allocated channel: c1
channel c1: sid=11 devtype=DISK

executing command: SET until clause

Starting restore at 17-FEB-05

channel c1: starting datafile backupset restore
channel c1: restoring controlfile
output filename=/home/sushrutha/control/cont1.ctl
channel c1: restored backup piece 1
piece handle=/home/oracle9i/OraHome1/dbs/28gcvrmv_1_1 tag=TAG20050217T121019 par
ams=NULL
channel c1: restore complete
replicating controlfile
input filename=/home/sushrutha/control/cont1.ctl
output filename=/home/sushrutha/control/cont2.ctl
Finished restore at 17-FEB-05
released channel: c1

RMAN> alter database mount;

database mounted

RMAN> run
2> { allocate channel c1 type disk;
3> restore database;
4> recover database;
5> }

allocated channel: c1
channel c1: sid=11 devtype=DISK

Starting restore at 17-FEB-05
resotre was completed
but recover was not possible. It is asking for an archive log file which does not exist.

Thanking u!!!
Re: URGENT ! RMAN - Incarnation [message #74795 is a reply to message #74791] Thu, 17 February 2005 06:33 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
may be the related files for scn 1046162 is not available!.
LOOK into point-in-time recovery ( refer documentaton for step-by-step information. actually oracle docs is the only place where you find these kind of information).

time1 - take backup1
time2 - drop the table
time3 - take backup2
time4 - use TSPITR ( tablespace point in time recovery)to
restore/recover database to some time prior to time2.
Previous Topic: archive log question
Next Topic: How to tackle Media Recovery?
Goto Forum:
  


Current Time: Thu Apr 25 05:57:03 CDT 2024