Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: QUESTION - rman 8i - how to capture last backed up sequence number...?

Re: QUESTION - rman 8i - how to capture last backed up sequence number...?

From: Steve Howard <stevedhoward_at_gmail.com>
Date: 8 Jun 2006 07:08:10 -0700
Message-ID: <1149775690.236979.112650@g10g2000cwb.googlegroups.com>


You could always ( I *think* this was in 8i)...

select max(sequence#) from v$archived_log where backup_count > 0;

Regards,

Steve

BD wrote:
> Hi, all.
>
> I'm using 8.1.7.4 on AIX 5.2.0.2.
>
> I'm working to automatically generate an rman recovery script, when my
> backup runs.
>
> At this point, the shell script that I use to run the backup job also
> logs into sqlplus and creates an rman script, that contains all the
> 'set newname' commands required - it renames data files, online redo
> files for their eventual recreation, with 'alter database' commands,
> and creates a new tempfile in the temp tablespace.
>
> After that is generated, I have a separate script, which runs 'sed'
> against that initial script, and substitutes volume names where
> necessary for the server which will be used for the recovery.
>
> Best of all, it actually works!! ;-)
>
> The only thing left for me to wrestle with here is how to capture the
> most recent backed-up sequence number, for the 'until' clause in my
> recover statement, as in
>
> recover database until logseq 3344 thread 1;
>
> I know one way I _could_ do it, would be: in rman, run a 'list
> backupset of archivelog all', spool that out to a file, then somehow
> using shell scripting, parse out the last sequence number in the list,
> and get that into my restore script when it's generated. I imagine it's
> doable that way, but haven't really worked out the logic yet.
>
> Before I take that on, I figured it would be worth checking to see if
> anyone else had any suggestions, assuming I want an incomplete recovery
> that will bring me as up to date as the most recent sequence number
> that was backed up...
>
> Thanks for any suggestions!
>
> BD
Received on Thu Jun 08 2006 - 09:08:10 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US