Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to determine Until Time in restore

Status
Not open for further replies.
Until time" is generally just before the problem occured that you're doing the restore for.

problem happens at 11:01

recover database.......... until time 11:00....

You don't use in cloning a database

Alex
 
Jouell,

once you've done your restore, and the database starts ok, make absolutely certain that the next thing you do is make another full RMAN backup. Failure to do so can have dire consequences.

Regards

Tharg

Grinding away at things Oracular
 
Hi all thanks for the info.

Sorry,I should have been more clear:

I am looking for a specific example of how someone has determined their:

a)SET UNTIL TIME
b)SET UNTIL SCN
or
c)SET UNTIL SEQUENCE

parameter assuming there is nothing on disk to restore from, just a tape backup.

Does that make sense?


 
Ok - so we're talking about this;

UNTIL TIME = 'date_string'
Specifies a time as an upper limit. RMAN selects only files that can be used to recover up to but not including the specified time. For example, LIST BACKUP UNTIL TIME 'SYSDATE-7' lists all backups that could be used to recover to a point one week ago.

UNTIL SCN = integer
Specifies an SCN as an upper limit. RMAN selects only files that can be used to recover up to but not including the specified SCN. For example, RESTORE DATABASE UNTIL SCN 1000 chooses only backups that could be used to recover to SCN 1000.

UNTIL SEQUENCE = integer THREAD = integer
Specifies a redo log sequence number and thread as an upper limit. RMAN selects only files that can be used to recover up to but not including the specified sequence number. For example, REPORT OBSOLETE UNTIL SEQUENCE 8000 THREAD 1 reports only backups that could be used to recover through log sequence 7999.

As I don't use RMAN, I can't help, but maybe its a bit clearer now for someone else :)

Alex
 
Jouell,

try the RMAN 'list incarnation' command, to see what's available. This will list the reset time and reset SCN for you.

Regards

Tharg

Grinding away at things Oracular
 
Ok so how would i query my rman catalog to obtain this info?


I don't think 'list incarnation' will do this.

That will show:

RESET SCN
the SCN at which the incarnation was created.

RESET TIME
the time at which the incarnation was created.

which is helpful but i'd like to see in the rman catalog where a backup finished.


Thanks!


 
The best thing I have found so far is this:

SQL> select max(next_change#)
from v$archived_log
where archived='YES'
group by thread#;

OR


SQL> select max(next_change#) from v$log_history;

as documented here:


RMAN-8060 Doing Duplicate Database on Recovered Database




But that still leads to:


RMAN-06025: no backup of log thread 2 seq 2817 scn 3193354318 found to restore
RMAN-06025: no backup of log thread 2 seq 2816 scn 3192569562 found to restore
RMAN-06025: no backup of log thread 2 seq 2815 scn 3191725873 found to restore
RMAN-06025: no backup of log thread 1 seq 2437 scn 3191725871 found to restore


errors about half the time.

I will persist.

-John
 
Said another way:

Assume in my datacenter I have two servers: one database on one and rman catalog on the other. We backup the db full every day to tape. Say the server with the DB catches fire one day and is destroyed. Say I get fired or run away, I am afraid of the fire...=) The secretary installs a new server and installs Oracle, but he doesn't know how to use rman.

A month passes and a new Oracle DBA steps in. His new manager hands him the tape and says "Here's a tape, restore the database, I am non-technical, and I don't when the backups ran " shrugs and walks away.

How does the new guy query the rman catalog to find out what scn or until time to use to restore the database to "The last good full backup "?
 
I found the easiest way to do this is to connect to the rman catalog and issue a "LIST BACKUP OF ARCHIVELOG ALL" command and look for the entry when the highest "Next SCN" value and then use the thread and sequence values listed there, which RMAN labels as Thrd and Seq.

That is the value of the last thread or archivelog you can recover to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top