Tag history for tag isn't created

I have gotten a very annoying problem, with tag history.

I’m working on a demo project where alot of changes occurs.
We have a MySQL database which is used for tag history and we have been removing unused tags and moved tags into other folders, which had tag history enabled. This made it so we got alot of dB error in the logs, so I wanted to clean up the database so that we would remove all the errors, this did work and almost every error was gone.

But i did the mistake to remove some of the tables “sqlt_data_x_xxxx_xx” cause we didn’t have any important data yet, which I later on found out that some tags was writing to and caused a store and forward error and quantied alot of data, but this has been fixed.

I did also clean the other “sqlth_xxx” tables to remove all the tag histories.

Now Im setting up the tags again, which we were going to use again, some where recreated and others are new. But those that were recreated doesn’t log data anymore, and when i look in the “sqlth_te” table I don’t see them anymore and the id doesn’t start at index 0, but at 69.

I feel like I have tried everything at this moment and now im seeking some help here on the forum.

If you need anymore information about the problem I will get the information that is needed.

If you want to start history from scratch (ie delete all tag history), I would stop ignition, then drop all of the history tables (sqlt*) and then start ignition back up again. Ignition will then recreate the tables and you'll start from fresh

As @nminchin alludes in his post, you are probably fighting the cache internal to Ignition. Stop data collection before any manual updates to Historian tables, perform the updates required, then restart your Ignition gateway before enabling data collection.

Thanks @nminchin & @Chris_Bingham for the reply

So as I understand is that, before ever tinkering with the database for tag history I would have to stop the gateway or maybe just disable the tag historian, then do my deal in the database, which I could understand from this link (Ignition Database Table Reference | Ignition User Manual) that I should be very cautious what I’m removing in the database.

So if I were to remove a tag that was used for tag historian, should i just turn off tag history on the tag and then remove it?

No...errr, maybe. The prior recommendation only comes into play when manually updating tables that Ignition has created (side note - strongly discouraged). If you simply want to stop collecting history on a tag, you can safely modify (or delete) the tag within Ignition without worry. If you intend to manually remove all records for a given tag via manipulation of the tables that Ignition created, tread lightly. In my opinion there's little to gain from manual updates to an Ignition Historian once the DB is in production.

In my experience, nothing you've outlined here should cause errors. Removing a tag, or moving a tag to a new location (from within Designer) should cause the 'old tag' to be marked as 'retired'. Replicating your issue and posting a summary here might help pinpoint the root cause.

The issue here though is that users will still see the old tags available for selection in the tag tree for example when selecting pens in the power chart, so you end up with confusing orphans. This is the reason to either reassociate the old history with the new tag, or removing the tag ids and their history (to save hdd space).

I don't believe this is an issue any more with 8.3 and the new quest DB historian, as this is handled automatically

1 Like

The new 7.3 historian API is supposed to aid in this. Has anyone tested it to see if it moves tag paths etc...? Would be curious to know any real world testing on it.