The sysaltusages system table is a new data-only-locked table that is used to map page numbers in an archive database to the actual page within either the database dump and its stripes or the modified pages section. However, unlike the sysusages table in a traditional database, the sysaltusages table does not map every logical page in the database. sysaltusages maps:
Pages that have been stored in a database dump
Pages that have been modified and therefore relocated to the modified pages section
sysaltusages has the following columns:
dbid location lstart start size vstart vdevno segmap
where:
dbid – is the database ID of the archive database.
location – is the location of the archive database segment where the physically contiguous block of pages resides.
A value of 5 and 6 means the location is in the database dump or its stripes, and a value of 7 or 8 means that the location is in the modified pages section. A value of 4 is used to fill the gaps for pages that are not physically available.
lstart – is the logical page number of the start of the block of physically contiguous pages.
size – is the number of logical pages in the block of physically contiguous pages.
vstart – is the offset of the start of the contiguous block of pages on the device given by vdevno.
vdevno – is the device number on which the contiguous block of pages resides.
segmap – is a map of the segments to which this block of pages is allocated.
The sysaltusages table looks similar to Figure 3-2.
Because sysaltusages is a row-locked
catalog, you may need to periodically use reorg to
reclaim logically deleted space.
Figure 3-2: The sysaltusages table
The scratch database stores the new sysaltusages table. The scratch database is used to provide flexibility as to where the sysaltusages table is located.
The scratch database can be any database (with some exceptions like master and temporary databases.) Sybase recommends that you dedicate a database that is used only as a scratch database, because:
The size of sysaltusages may vary depending on the number of archive databases it supports. You cannot decrease the size of a database, but if it is too large, you can drop it and re-create a smaller database when required.
It allows you to turn on the "trunc log on checkpoint" option so that the database log be automatically truncated.
Apart from hosting the sysaltusages table, this database is like any other. You can use threshold procedures and other space management mechanisms to manage space within the database.
You can specify a database that may be used as a scratch database by entering:
sp_dboption <db name>, "scratch database", "true"
Each archive database can be assigned to only one scratch database at a time, but multiple archive databases can use the same scratch database. If you have a large number of archive databases, you may want to define multiple scratch databases.