Which ai sequence

Posted by jmls on 28-May-2012 04:11

Trying to write a script that applies ai - at the moment it's a brute force method :

a) get all .ai files in the aiarchiver directory

b) try to apply 'em .

c) When done, move out to another folder.

I want a smarter way:

a ) find sequence needed

b) get list of all files >= sequence needed

c) apply those files

And, of course, I'm stuck at a) ')

How do I fond out which sequence is needed ?

Looked in the docs until my eyes were bleeding to no avail.

Thanks

All Replies

Posted by Admin on 31-May-2012 03:40

Julian,

Finding the first AI extent to apply on a backup can be done by parsing db.archival.log. Lines starting with 0032 are backups, and the ninth field indicates first AI sequence. Then parse 0001 lines, the seventh field is AI sequence and ninth field is archived extent location. And apply subsequent extents.

Gilles

Posted by jmls on 02-Jun-2012 01:34

Right - but the file only tells me what sequence was stored where. I don't know which sequence is next to be applied, as the backup db already has ai's applied (think hot spare)

Posted by jmls on 02-Jun-2012 01:50
Posted by jmls on 02-Jun-2012 02:15

ok, for the sake of others, here's a crappy little dos script that does what I need.

The idea is to have a "standard" ai file (take the first one made after a ai enable) , try to apply it to the db, and parse the errors to get the ai sequence needed

@echo off
FOR /F "tokens=1 delims=" %%A in ('rfutil <> -C roll forward -a <>^|find "(8019)"') do SET result=%%A

for /f "tokens=5,10" %%a in ("%result%") do (
set expected_ai=%%a
set got_ai=%%b
)

echo Expected:%expected_ai%

works for me

This thread is closed