AI Restore...talk me through it like I'm a Microsoft guy (I am)

doom1701

Member
Thankfully, I've never had to do anything with our AI files. The one time I had a DB go really, really south, it was overnight and only a couple of hours after the nightly backup. Since the job scheduler restored to it's previous state anyway, I just let it get the overnight stuff caught up. But I would like to know how to restore/reapply/whatever my AI files in case the need ever comes up.

Here's our current setup:

Progress 10.1b database running on Red Hat Linux.
AI is "managed" by scripts provided by the ERP vendor, but I'll include the important commands below.
Every 5 minutes, a script runs that checks for full extents (_rfutil <db> -C aimage extent list), copies them to an archive folder with a unique sequential number as it's file extension, and then marks that extent as empty (-C aimage extent emtpy <extent number>). We usually wind up with around 150 copied extents each week (ie, <dbname>.1 through <dbname>.150).
Every weeknight an online backup runs. Nothing is done to AI at this time.
Every Saturday, an offline backup is made. At this time, AI is rolled over to the next empty extent (-C aimage new), and then shut down. All of the extents are "archived". After the backup, AI is marked as backed up (-C mark backedup) and restarted. This also resets the counter used by the archive script, so archived files start off with "<dbname>.1" again.

Let's say things go south on Wednesday afternoon. What would I do?
 

zee

New Member
Disclaimer: I'm more of a Microsoft techie myself, and am not responsible for this type of thing. BUT ... we do have documentation and I have followed the procedure when we lost power once. Here's what we have:

Restore the database. (Assuming you know how to do this)
(We have a step to uncompress the database files from the backup directories... not sure if you need to do this or not.)
Disable ai: rfutil <db> -C aimage end
Roll forward the ai: rfutil <db> -C roll forward -a <ai file #1> (repeat as needed, for each additional ai file)
Mark the database as backed up: rfutil <db> -C mark backedup
Enable ai: rfutil <db> -C aimage begin

Hope this is helpful!
 

doom1701

Member
Disclaimer: I'm more of a Microsoft techie myself, and am not responsible for this type of thing. BUT ... we do have documentation and I have followed the procedure when we lost power once. Here's what we have:

Restore the database. (Assuming you know how to do this)
(We have a step to uncompress the database files from the backup directories... not sure if you need to do this or not.)
Disable ai: rfutil <db> -C aimage end
Roll forward the ai: rfutil <db> -C roll forward -a <ai file #1> (repeat as needed, for each additional ai file)
Mark the database as backed up: rfutil <db> -C mark backedup
Enable ai: rfutil <db> -C aimage begin

Hope this is helpful!

That gives me a good start. It sounds like I don't need to move the archived extent back into the "current" ai extents--just reference the archived file.

Any idea on A) If I can restore from my online weekday backups (that don't mark AI at all), and B) if so, how I tell what AI files I need to roll forward? It sounds like my best bet is to just restore the Saturday offline backup and then roll forward all of the AI files starting with <dbname>.1 until the last one. If that is the case, it kinda makes me wonder what benefit my weeknight backups really are.
 

TomBascom

Curmudgeon
There is no need to disable ai after a restore with prorest -- it is done automatically. It is however very important to remember to re-enable ai after finishing your roll-forwards. Otherwise you're running without protection :(

That gives me a good start. It sounds like I don't need to move the archived extent back into the "current" ai extents--just reference the archived file.

That is correct.

Any idea on A) If I can restore from my online weekday backups (that don't mark AI at all),

Yes.

and B) if so, how I tell what AI files I need to roll forward?

Guess. If you guess wrong the error message will tell you what you should have guessed. You can do no harm attempting to roll forward the wrong archived extent.

It sounds like my best bet is to just restore the Saturday offline backup and then roll forward all of the AI files starting with <dbname>.1 until the last one. If that is the case, it kinda makes me wonder what benefit my weeknight backups really are.

Belt & suspenders...

Let me guess... this is SXE isn't it? That weekend process is kind of silly. I'd get rid of the "stop ai, restart ai" stuff if I were you. Why on earth limit yourself to only having one week of recovery?
 

doom1701

Member
Let me guess... this is SXE isn't it?
Wow, you are truly a mind reader. :)

That weekend process is kind of silly. I'd get rid of the "stop ai, restart ai" stuff if I were you. Why on earth limit yourself to only having one week of recovery?

Never thought about it that way; my guess is that they came up with their procedures in more of a "You backup your database for protection; AI is a secondary tool" train of thought.

Thanks for the info; makes me feel a lot more comfortable about the tools now that I have a good idea how to use them.
 
Top