ihArchives Table

Historian archives are stored as data files, each of which contains data gathered during a specific period of time.

The ihArchives table contains Historian archive configuration information and performance statistics for each archive. Each row in this table represents one archive. The following table describes the columns of the ihArchives table.
Table 1. ihArchives Table
Column NameData TypeDescription
ArchiveNameVT_BSTRName of the archive for the current server if the authenticated user is a member of Historian Administrators group.
ArchiveStatusVT_BSTRThe status of the specified archive:
  • Undefined
  • Empty
  • NotEmpty
FileNameVT_BSTRThe file name for the specified archive. The file name must be specified in the context of the Historian server drives and directories.
IsCurrentVT_BOOLIndicates whether the specified archive is the newest archive that new data currently flows into.
IsReadOnlyVT_BOOLIndicates whether the read-only status is set for the specified archive.
FileSizeCurrentDiskVT_I4The actual space on the hard disk (in MB) for the specified archive.
FileSizeCurrentVT_I4The size of the archive file that is currently being used (in MB) for the specified archive.
FileSizeTargetVT_I4The target size of the specified archive file (in MB).
StartTimeVT_DBTimeStampThe start time of the specified archive. This represents the earliest timestamp (including date and time) for any tag contained in the archive.
EndTimeVT_DBTimeStampThe end time of the specified archive. This represents the latest timestamp (including date and time) for any tag contained in the archive.
LastBackupVT_DBTimeStampThe date and time the most recent online backup was performed on this archive.
LastBackupUserVT_BSTRThe name of the user who performed the most recent online backup.
LastModifiedVT_DBTimeStampThe date and time that the archive was last modified. The time structure includes milliseconds.
LastModifiedUserVT_BSTRThe username of the Windows user who last modified the archive.
TimeZoneVT_BSTRThe type of time zone used:
  • Client
  • Server
  • Explicit bias number (number of minutes from GMT).
DaylightSavingTimeVT_BOOLIndicates whether Daylight Saving Time logic should be applied to timestamps.
RowCountVT_I4Indicates the maximum number of rows that can be returned. A value of 0 indicates there is no limit to the number of rows returned.
DataStoreNameVT_BSTRIndicates the name of the data store the tag belongs to.

ihArchives Examples

A task that you might want to perform on the ihArchives table is retrieving and recording the state of the archives and archive sizes when an event happens. Recording conditions when an event happens is useful in troubleshooting.

Sample SQL statements for the ihArchives table are outlined in the following examples.

Example 1: Retrieve the Archive List Sorted by StartTime

SELECT archivename, starttime, endtime
FROM iharchives ORDER BY starttime

Example 2: Retrieve All Properties of the Current Archive

SELECT * FROM iharchives WHERE iscurrent=true