It seems like our AI images gets out of synch after online backup and subsequent db shut down. I.e. while trying to roll forward ai extents after restoring from the backup Progress complains and says it wants file NNN instead of 1.
1. Perform online backup
2. Shut down DB
3. Truncate BI
4. Shut down AI
5. Start AI
6. Start DB
Does anyone have any suggestions?
That happens because you make the backup and then turn off ai and turn it on again, which sets the ai sequence number to 1 on the live database.
Before you do any of this, lets say the current ai sequence number is 103 and that is the current ai extent.
0) Notes for database changes are being written to file no. 103. (the current ai extent).
1) You do the online backup, which also causes an ai extent switch to number 104. So anything that happens after the backup starts going is recorded to 104 (and subsequently to 105 if 104 becomes full).
2) You shut down the database, turn off ai and tune it back on again and restart the database. Now the ai sequence numbers have been reset and changes will be recorded into the extent with seuqnce number 1. (and 2 and 3 and so on).
3) You restore the backup made earlier, which says that the next extent is 104. This backup does not know you shut off ai after it was made.
4) You roll forward the first extent created after you restarted ai. This has sequence number 1, which is not the expected one.
You do not need to start the ai numbering over again. If you do, you need to do a backup too.
Thanks for the quick answer!
So since I'd like the AI numbering to start at 1 with the current database backup:
1. Shut down DB
2. Shut down AI
3. Perform OFFline backup
4. Truncate BI
4.5 Clean out old AI files & gather stats
1. Shut down AI
2. Perform ONline backup
4. Start AI
Guess we can skip #3 in the 2nd option
You could actually skip the Truncate BI in both varients if you like. Unless you've had an unusual growth in BI size, it's probably best to leave it alone.
With you'r second option, there's no point doing an online backup at this stage. You can't switch on After Imaging with the database online today. Something to look forward to in a future release might be a command like:
probkup online ...
If you do an online backup with the OpenEdge versions available today, you have to shut down the database to switch on after imaging. The shutdown will effectively be making changes to the database and as such, you don't have a valid database backup .
So, in short switching on AI is an offline process today (but may be an online option sometime soon).
So since I'd like the AI numbering to start at 1 withthe current database backup:
So since I'd like the AI numbering to start at 1 with
the current database backup:
Why do you want to do that?
Don't shutdown AI unless:
1) What you are about to do is 100% repeatable
2) You have good backups
3) You're prepared to restore those backups
If you really need to start with extent #1 rotate the current extent number by forcing extent switchs via "rfutil dbname -C aimage new"...
The second option (disable ai, do online backup, truncate bi, enable ai) WILL NOT work.
To roll forward after restoring a backup, you must have a set of ai logs that contain only database changes that are made /after/ the backup, and starting with the /first/ such change. Since database changes can be made after the online backup program starts and also while it is running, starting ai after the online backup has finished means you will not have ai logs that are properly synchronized with the backup. You will not have an ai log that has the changes that happened while the backup program was running, and you will not be able to roll forward using that backup.
If ai is already enabled and you do an online backup, the backup program will do an ai extent switch at the proper moment so starting with the ai extent the backup switched /to/, you can roll forward from that backup.
And, since you have to shut the database down to do the bi truncate (which is not usually needed, and start ai, you might as well do an offline backup anyway. Note that the offline backup program does not incloude the bi log contents (unless you give it the -norecover option) but the online backup program does.
Message was edited by: