• No se han encontrado resultados

INTERCAMBIO DE CARBONO ENTRE EL ECOSISTEMA Y LA ATMÓSFERA

3.11 Managing Archive Shifts

When the primary archive file becomes full, the next empty (shiftable, writeable) archive is used to store the new data. If none of the archives are empty, the archive file with the oldest data (which is also shiftable and writeable) is cleared and used for new data. The start time of this archive is set to the end time of the archive file that just became full.

The process of clearing the oldest archive and preparing it to be the new primary archive is called an archive shift. It is important that all eligible archives are backed up prior to the archive shift to ensure that no data is lost.

When an archive is assigned a start time, it is initialized. Archives are only initialized at installation and during an archive shift.

The archive shift process takes a few minutes to initialize a new archive file. Adding, editing, or deleting points is not allowed during archive shift. Events sent to the Archive during an archive shift are queued. When the shift is complete, the queued events are written to the Archive.

Which Archives are Shiftable

For an archive file to be eligible to be the new primary archive, it must be registered, shiftable, writeable, and large enough to handle the current size of the Point Database. If an archive does not meet these criteria, it will be skipped over during an archive shift. By making an archive non-shiftable or read only, an archive may be excluded from the shift cycle.

Predicting Time of Next Archive Shift

The command piartool -as is used to monitor archive activity, performance and to estimate the next archive shift

The utility piartool -as predicts the time for the next archive shift. The prediction is based on the average number of archive records consumed per hour, plus the rate of consumption. If the primary archive is less than 20% full, the prediction is based on the previous archive rates.

Archive Shift Enable Flag

Fixed archives of varying sizes can be shifted. However, archives that are too small to accommodate the number of points in the Point Database are automatically excluded from archive shifts. Used dynamic archives are never shiftable.

Both fixed and dynamic archives have a shift-enable flag. If the flag is 0 then the archive will not participate in archive shifts. A user can view or set this flag using the piartool utility.

Failed Archive Shifts

If an archive shift fails for any reason, all further shifts are disabled and a message is sent to the log. When the cause of the failure is resolved, restart the Archive Subsystem to enable archive shifts. If the cause of failure was a lack of available archive to shift into, then

registering a new empty archive automatically resolves the situation and a shift into the new archive will occur.

Failed shifts do not cause any data loss since the archive goes into read-only mode. All incoming data is queued in the Event Queue by the Snapshot Subsystem.

3.11.1 Archive Shift Enable Flag

Each archive has a Shift Enable Flag. If the Shift Enable Flag is set to 1 then the archive is eligible to participate in archive shifts. The status of the flag may be viewed using piartool - al.

Archives can be excluded from shift participation by running piartool -ads 'path'. Shift disabled archives can be re-enabled by running piartool -aes 'path'.

Dynamic archives that contain data do not participate in archive shifts. That is, newly created dynamic archives may be shifted into, but they are shift disabled after the first archive event is written to it. piartool -aes does not re-enable dynamic archives for shifting.

Archive shifts happen automatically whenever the Primary Archive nears full. An archive shift normally begins when the Archive Subsystem detects that the primary archive is almost full. It dismounts the last empty archive, or oldest shiftable archive if no empty archives are available. It then initializes this archive. This can take some time, depending on the current point count. Messages are written to the log during the initialization to indicate progress. Once the new archive cleared, it is initialized to start at the current time and is mounted as the primary archive.

Note: The oldest shiftable archive is the oldest writable archive large enough for the

current point count. Also, dynamic archives containing data are not shiftable.

3.11.2 Forcing Archive Shifts

The command piartool -fs forces an immediate archive shift. During normal operations, the piartool -fs command should not be used. However, it may be useful to force an archive to shift while testing your system or to do advance archive management.

For example, this command is sometimes useful if you are building a large number of new points. Since primary records may occupy no more than one half of the records in an archive file, it may be necessary to build a larger primary archive. You can then force an archive shift to make the larger archive your primary archive.

For systems with large point counts, archive shifts may require a long time. As soon as the shift starts, messages are written to the PI message log, such as:

0 piarcmgr 2-Apr-03 14:32:39

>> Forced archive shift requested. 0 piarcmgr 2-Apr-03 14:32:39

>> Beginning Archive Shift. Current Primary Archive: d:\pi\dat\piarch.001

0 piarcmgr 2-Apr-03 14:32:39

>> Target Archive for Shift: d:\pi\dat\piarch.003 0 piarsrv 2-Apr-03 14:32:39