I have following issues with Core Historian. The suggested solution from the error is to remove partition table but since the Historian is supposed to a black box, is there a way of fixing this issue without trying to get write access to the Historian somehow?
Additional detail:
- Current I am using Ignition 8.3.3
- Core Historian Settings are below
- It is currently setup is as a Splitter with another SQL Historian
- The issue started when the SQL Historian had LOG_BACKUP full error
- That issue has been rectified by setting it to RECOVERY to simple in the database
- However, it seems to have cause issues to Core Historian which still persist now
- I have attempted to delete/rename and recreate History_Core historian as well as reenable Historian Module.
Any help would be appreciated. Thanks
Just an update:
Got a response from Ignition Help (very prompt).
Note these steps are best to be performed with Ignition being stopped as it means the Core Historian DB copy that is taken and adjusted for the required fix doesn't get changed during the time it takes to do the fix.
Also, it is advised to take a second copy of the following mentioned 'db' folder and save to another location(temporarily to the desktop is suitable).
Gain Access to a current copy of the Ignition Core Historian DB:
-
Download QuestDB 9.1.0 https://github.com/questdb/questdb/releases/tag/9.1.0 (as this version is compatible for 8.3.3)(needs to be the exact same version)
-
Extract the folder and open up an admin CMD Terminal
-
Navigate into the bin folder (cd C:\Users\<username>\Downloads\questdb-9.1.0-rt-windows-x86-64\questdb-9.1.0-rt-windows-x86-64\bin)
-
Run .\questdb.exe install and then .\questdb.exe start, this will create a folder called qdbroot under your system32 directory (C:\Windows\System32)
-
Run .\questdb.exe stop
-
Navigate to the Core Historian's directory (C:\Program Files\Inductive Automation\Ignition\data\var\com.inductiveautomation.historian\corehistorian)
-
Copy the Core Historian's 'db' folder into C:\Windows\System32\qdbroot and replace all files.
-
Run .\questdb.exe start
-
On a web browser navigate to localhost:9000, you should see all tables of the Core Historian
Make changes to address the issue:
-
Run the SQL query wal_tables and observe the core.datapoints row, where it likely appears as true on the suspended column and the writerTxn and sequencerTxn likely have different values.
- As the
core.datapoints row is currently suspended and the values of writerTxn and sequencerTxn are not matching. We need to run an ALTER query on the row to fix this.
-
Run ALTER TABLE "core.datapoints" RESUME WAL FROM TXN {writerTxn},
- After running the command we should see it match the
sequencerTxn, if it does not match, we'll need to keep running the command with the new writerTxn until it matches the sequencerTxn.
-
Following that, Run the SHOW PARTITIONS FROM "core.datapoints" to see all partitions in the Core Historian.
-
Confirming that the table of interest(as noted in the error log, exists, checking to see if it has null values on the minTimestamp and maximumTimestamp as well as an empty disk space.
-
If it does continue with the following steps, otherwise if it does not, reach out again to Support to confirm next steps.
-
Run the ALTER TABLE core.datapoints FORCE DROP PARTITION LIST '<partition_name>' to drop the table out of the Core Historian.
-
Double-check on the wal_tables query that the core.datapoints has matching writerTxn and sequencerTxn (note you may not see false under suspended, but that is fine**).**
-
Double-check the partitions from the core.datapoints table that the corrupted table has been removed.
-
Back on CMD, Run .\questdb.exe stop
-
Navigate to the qdbroot folder (C:\Windows\System32\qdbroot) and copy the 'db' folder
-
Paste the copied 'db' folder directly into the Core Historian's installation directory (C:\Program Files\Inductive Automation\Ignition\data\var\com.inductiveautomation.historian\corehistorian) and replace all the files.
-
Start the Ignition Gateway Service.
Verify the table has reconnected as expected and data is accessible:
-
Open a session(Designer or Perspective) that has a Power Chart on it,
-
Dragged a tag onto the Power Chart and ensure data maps as expected.
-
Access Gateway Web Page Status>logs to observe the loggers and confirm the pre-seed and post-seed errors are no longer being recorded.
2 Likes