When the AI Management feature is enabled, it is sometimes necessary to manage FULL ai extents with either AIARCHIVE NEXTEXTENT or AIARCHIVE EXTENT:
- When all fixed AI extents are full and the database stalls when the current BUSY extent cannot switch to the next extent in the current aisequence (-aistall)
- When the current variable BUSY ai extent keeps extending because the next aisequence is FULL or LOCKED
- When permissions, access, full disk space or insufficient remaining space for the current full extent prevents archiving to the archive directory
AIARCHIVE NEXTEXTENT vs AIARCHIVE EXTENT
1. ARCHIVE EXTENT
- Can be run online or offline to manage used ai extents and the AI File Management feature does not have to be enabled to use it
- When run online the AIMD cannot be running when executed
- When used offline, there needs to be sufficient space in the current AI file or enough AI files to switch to in order to record bi recovery Redo and Undo notes.
- AIARCHIVE EXTENT, will archive a specific FULL or LOCKED extent to the directory specified and mark this database ai extent EMPTY/ARCHIVED once archived successfully to a target directory with sufficient disk space.
- To archive a specific after-image extent as opposed to the first and all subsequent extents:
$ rfutil dbname -C aiarchiver end
$ rfutil dbname -C aimage list | egrep -i "Status|Path"
$ rfutil dbname -C aiarchive extent <path>/dbname.a1 FULL/NEW/ARCHIVEPATH>/<datetime_>dbname.a1
$ rfutil dbname -C aimage list | egrep -i "Status|Path"
$ _mprshut dbname -C aimgt -aiarcdir <FULL/ARCHIVEPATH> -aiarcinterval n
2. AIARCHIVE NEXTEXTENT
- Requires AI File Management feature to be enabled and cannot be run offline:
The Aiarchive nextextent operation cannot be performed because the after-image extent manager is not available. (13274)
- AIARCHIVE NEXTEXTENT, will force FULL extents to be archived online and mark the ai extent EMPTY (or ARCHIVED when they are LOCKED by replication) once archived successfully
- All ai extents in the current ai-sequence order will be archived to the current archive directory immediately and the timer on timed mode on the AIMGT deamon process will be reset
- It can be used whether the AIMD is running, or has previously been stopped or has stopped running online, but not if it was disabled online
- Since the daemon process can be running, first reset the archive interval to a high value in seconds to assure the AIMD is not in the middle of an archiving operation when this command is executed:
$ rfutil dbname -C aiarchiver setinterval 14400
$ rfutil dbname -C aiarchive nextextent
$ rfutil dbname -C aiarchiver setinterval <n> - Alternatively stop the daemon first. At typical use-case is when the AIMD is running and switches ai extents at the timed-mode but the first FULL ai file in sequence cannot be archived due to the size of the variable extent and insufficient available disk space or other issues in the archive directory. Once the first extent is archived all remaining FULL extents will be archived:
$ rfutil dbname -C aiarchiver end
$ rfutil dbname -C aiarchiver setdir <fullpath\to_new_aiarc
$ rfutil dbname -C aiarchive nextextent
$ $ _mprshut <dbname> -C aimgt -aiarcdir <FULL/ARCHIVEPATH> -aiarcinterval n
EXAMPLE: aiarchive nextextent run online
$ rfutil dbname -C aimage list
Extent: 1
Status: Full
Extent: 2
Status: Full
Extent: 3
Status: Locked
Extent: 4
Status: Busy
Extent: 5
Status: Empty
$ rfutil dbname -C aiarchive nextextent
Marked after-image extent aiarc\dbname.a1 EMPTY. (3789)
Marked after-image extent aiarc\dbname.a2 EMPTY. (3789)
Marked after-image extent aiarc\dbname.a3 ARCHIVED. (3789)
The resulting database lg file entries:
(7129) Usr 6 set name to Aiarchive nextextent.
(13199) After-image extent aiarc\dbname.a1 has been copied to aiarc\ais1\aiarc~dbname.20201010.161343.00000043.dbname.a1.
(3789) Marked after-image extent aiarc\dbname.a1 EMPTY.
(13199) After-image extent aiarc\dbname.a2 has been copied to aiarc\ais1\aiarc~dbname.20201010.161343.00000044.dbname.a2.
(3789) Marked after-image extent aiarc\dbname.a2 EMPTY.
(13199) After-image extent aiarc\dbname.a3 has been copied to aiarc\ais1\aiarc~dbname.20201010.161343.00000045.dbname.a3.
(3789) Marked after-image extent aiarc\dbname.a3 ARCHIVED.
(453) Logout by Aiarchive nextextent
And recorded in the dbname.archival.lg file:
0001,aiarc\dbname,20201020,161157,20201010,161343,43,aiarc\dbname.a1,aiarc\ais1\aiarc~dbname.20201010.161343.00000043.dbname.a1
0001,aiarc\dbname,20201020,161157,20201010,161343,44,aiarc\dbname.a2,aiarc\ais1\aiarc~dbname.20201010.161343.00000044.dbname.a2
0001,aiarc\dbname,20201020,161157,20201010,161343,45,aiarc\dbname.a3,aiarc\ais1\aiarc~dbname.20201010.161343.00000045.dbname.a3