Databases

SQLite® Database Schema

Note: If you update a version lower than 3.19 P010, you must adjust the database schema manually as this cannot be automated during the project upgrade. New projects with patch 3.19 P011 and higher use the new schema and are not affected.

Convert the Database in case of a high Disk Usage

Note: These steps apply to patches 3.19 P000 to P010.
  1. Stop the project.
  2. Open the command line and navigate to the project's database folder.
  3. Run this command:
    <OA INSTALL>/bin/sqlite3.exe .\last_value.sqlite "PRAGMA journal_mode=TRUNCATE;PRAGMA page_size=512;VACUUM;PRAGMA journal_mode=WAL;"
  4. Test the result by running this command:
    <OA INSTALL>/bin/sqlite3.exe .\last_value.sqlite "PRAGMA journal_mode;PRAGMA page_size;"

    If the conversion was correct, the output of the command should be:

    wal512
  5. Repeat the commands for the other DB files.

PostgreSQL® Schema Indices

The PostgreSQL® schema was changed from BRIN indices to BTREE indices in version 3.20. BRIN indices in the PostgreSQL® schema are therefore obsolete. You can request a tool/script for converting an existing PostgreSQL® database from BRIN to BTREE from WinCC OA support.