Back

Topic

[KB654]How .hds files work ?

Tags: HDS, SQL, SQL Server

11 years ago
By ACHT
Options
Print
Applies to:

PcVue version 8.10 onwards.


Summary:

This article explains why the file “ProjectName_DatabaseName_TableName.hds” in the Databases directory contains records.


Details:

.hds files are created in the directory containing the PcVue databases at startup if the database initialization is done properly (Database status check at startup). There is a file for each table in the database. These files are used to store records when the HDS is no longer able to access the database. These files are used as a buffer. They are pushed into the database in masked time.

These files are filled in the following cases:

  • The database is not valid
  • The database is not created
  • The database is not checked
  • The database is not connected
  • The database needs a reconnection
  • The database does not respond
  • The database is paused
  • All the columns of the tables are not created
  • The tables are not accessible
  • The insertion of the recording cannot be possible, rejected by the SQL server

These files should be temporary and occasional. If you observe a constant evolution of these files, your system is not stable.

Filling mechanism

These .hds files are not limited in size.

We can see in the traces (HDS.log files) these files are filled when HDS calls the function SaveInvalidRecord:
,HDS,A,0,0,SaveInvalidRecord on ‘TRENDTABLE1’

These files are un-stacked when calling the function RecordAscii. The RecordAscii function is started each time the project starts and every 30 seconds for 3 seconds if the file is not empty:
,HDS,A,0,0,RecordAscii on ‘TRENDTABLE1’

If RecordAscii is followed by the RecoverInvalidRecord function, it means that the file has been emptied:
,HDS,I,0,0,RecoverInvalidRecord on ‘TRENDTABLE1’ Reseting

Problem

Sometimes the .hds files increase in size. The problem is that your database is too often occupied by other treatments.

Two hypotheses:

  1. The .hds file fills faster than it un-stacks. The RecordAscii function is started every 30 seconds for 3 seconds. There are too many records in the file.
  2. If, during the insertion of the records, recording could not be inserted into the database the record is duplicated in the .hds file.

Resolution

If the file gets very big, it may be that the HDS cannot open the file (Windows file size limitation) and therefore the file cannot be un-stacked into the database. You can follow the procedure below to workaround this issue.

  1. Stop PcVue.
  2. Move the file to another temporary directory and split it in smaller files using any third party utility.

Then, for each smaller file:

  1. Put the file in the Databases directory and rename it “ProjectName_DatabaseName_TableName.hds ”
  2. Launch PcVue and wait for the file to be un-stack (file size must be 0 Kb)
  3. Stop PcVue


Created on: 10 Jul 2013 Last update: 13 May 2024