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
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
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)
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