Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Getting log number for recovery
On Wed, 19 May 1999 18:03:39 -0700, "AJG" <noemail_at_noemail.noemail>
wrote:
>Hello,
>
>I have the following situation: A database, fully restored from a hot
>backup, and I have not started the recovery yet.
>
>I want to know what log sequence number it's going to ask for when I start
>the recovery.
>
>How do I do this besides running the recover command?
>
>I've been looking around the v$ tables, but have come up with nothing.
You could do thefollowing:
1. STARTUP MOUNT;
2. Dump the file headers to trace file. You can do this by setting the
following event:
ALTER SESSION SET EVENTS 'immediate trace name file_hdrs level 10';
This will create the trace file. It will contain the informations from file headers of each of the data files. Find the lowest system change number (scn) among all the file headers. The lines showing this in a trace file look something like:
Checkpoint cnt:1337 scn: 0x0000.0000e560 stop scn: 0xffff.ffffffff 05/20/99 14:36:28
SCN is given in hex format, in the above example it's 58720.
3. Query the V$LOGHIST to find the archived log that contains this SCN: SELECT MAX(sequence#) FROM v$loghist WHERE first_change# <= 58720;
>Thanks!
>
>Alan.
HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)
![]() |
![]() |