Managing Archive Size

From InterBase

Go Up to Journaling and Disaster Recovery


As the number of archived journal files grows, recovery time increases. To keep the archive from becoming too large, you can use any of the following options:

  • Run the gbak -archive_database command to create a new dump, thereby reducing the number of journal files InterBase needs to keep the archive up-to-date.
  • Run the gfix command to set a maximum number of dumps to allow in the archive:
gfix -archive_dumps <number> db_name
When the number of database dumps in the archive exceeds the <number> given, older dumps and journals will be deleted.
  • Run the gfix -archive_sweep command to manually control archive size (described below).

About Archive Sequence Numbers and Archive Sweeping

All archived items are denoted by an archive sequence number that corresponds to the order in which the items were created in the archive.

To remove all files in an archive with a sequence number lower than a number you specify, use the following syntax:

gfix -archive_sweep <archive_sequence_no> [-force] db_name

If an archived item cannot be swept (garbage-collected), the sweep will stop and return an error status. Sometimes all lower sequenced items cannot be deleted. For example, a database dump may depend on a lower sequenced journal file with which to start recovery. In that case, InterBase will automatically adjust the given sequence number to a lower number, so that this dependency is not lost.

Tracking the Archive State

To track the state of the archive, use the RDB$JOURNAL_ARCHIVES system table. The gbak and gfix commands use this system table to decide which archive items are targets for the command.

The following table describes column and data type information for RDB$JOURNAL_ARCHIVES.

Column Name Data Type Length Description

RDB$ARCHIVE_NAME

CHAR

1024

The name of the archived item.

RDB$ARCHIVE_TYPE

CHAR

1

The type of the archived item. 'D' indicates a database dump. 'S' indicates a secondary database file of a database dump. 'J' indicates a journal file.

RDB$ARCHIVE_LENGTH

INT64

8

Length of the archived item as stored in bytes.

RDB$ARCHIVE_SEQUENCE

INTEGER

4

Sequence number of archived item.

RDB$ARCHIVE_TIMESTAMP

TIMESTAMP

8

Timestamp when item was stored in the archive.

RDB$DEPENDED_ON_SEQUENCE

INTEGER

4

Sequence of archived item that this item depends on. For 'S' archive types, it would be the sequence no. of the 'D' primary database dump file. For 'D' archive types, it is the sequence no. of the starting journal file for recovering from the archive.

RDB$DEPENDED_ON_TIMESTAMP

TIMESTAMP

8

As above, but the archive timestamp for the archived item that this item depends on.


Advance To: