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.Column Name | Data Type | Description |
---|---|---|
ArchiveName | VT_BSTR | Name of the archive for the current server if the authenticated user is a member of Historian Administrators group. |
ArchiveStatus | VT_BSTR | The status of the specified archive:
|
FileName | VT_BSTR | The file name for the specified archive. The file name must be specified in the context of the Historian server drives and directories. |
IsCurrent | VT_BOOL | Indicates whether the specified archive is the newest archive that new data currently flows into. |
IsReadOnly | VT_BOOL | Indicates whether the read-only status is set for the specified archive. |
FileSizeCurrentDisk | VT_I4 | The actual space on the hard disk (in MB) for the specified archive. |
FileSizeCurrent | VT_I4 | The size of the archive file that is currently being used (in MB) for the specified archive. |
FileSizeTarget | VT_I4 | The target size of the specified archive file (in MB). |
StartTime | VT_DBTimeStamp | The start time of the specified archive. This represents the earliest timestamp (including date and time) for any tag contained in the archive. |
EndTime | VT_DBTimeStamp | The end time of the specified archive. This represents the latest timestamp (including date and time) for any tag contained in the archive. |
LastBackup | VT_DBTimeStamp | The date and time the most recent online backup was performed on this archive. |
LastBackupUser | VT_BSTR | The name of the user who performed the most recent online backup. |
LastModified | VT_DBTimeStamp | The date and time that the archive was last modified. The time structure includes milliseconds. |
LastModifiedUser | VT_BSTR | The username of the Windows user who last modified the archive. |
TimeZone | VT_BSTR | The type of time zone used:
|
DaylightSavingTime | VT_BOOL | Indicates whether Daylight Saving Time logic should be applied to timestamps. |
RowCount | VT_I4 | Indicates the maximum number of rows that can be returned. A value of 0 indicates there is no limit to the number of rows returned. |
DataStoreName | VT_BSTR | Indicates 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