PostgreSQL® Server Installation
Starting with the WinCC OA version 3.18, the NGA manager also includes a backend to use the relational, open-source PostgreSQL® database for historical archiving and querying of value changes and alerts. The functionality of NGA InfluxDB® and PostgreSQL® backend is identical except mentioned separately.
The PostgreSQL® database and its installation software of the database are not part of WinCC OA.
PostgreSQL® Server Installation Steps
To create a database instance of the PostgreSQL®, proceed as follows. Consider also the notes in the chapter Troubleshooting PostgreSQL® :
- Install PostgreSQL® 13 (PostgreSQL® 13 can be downloaded under https://www.postgresql.org/download/ ). Make sure the check box to install pgAdmin is checked. This tool is very useful to browse the database. For supported operating
systems for PostgreSQL® Server, see chapter Software requirements.
CAUTION: Install PostgreSQL® 13 on all computers on which a PostgreSQL®-Backend runs or "Direct Read" is used via PostgreSQL® backends.Note: Check whether the PostgreSQL installation path is contained in the PATH variable. If this is not the case, add the location of the directory with the PostgreSQL® binary files (e.g. C:/Program Files/PostgreSQL/13/bin directory) to the PATH variable.
- Under Linux the WinCC OA SQLDrivers package:
WinCC_OA_3.18.0-SqlDrivers-rhel.x86_64.rpm
is required for the NGA - database connection when PostgreSQL® is used. - Create the database directories db, events, alerts, backups in your desired directory, e.g. C:/postgresql_backend/.
Note: The backup folder must be accessible to the users under whom WinCC OA is running.
- Edit the winccoa_path/data/NGA/PostgreSQL/sql/db.windows.config /db.linux.config file under
C:/postgresql_backend/
with the directories just created, for example:# DB Paths dbPath=c:/postgresql_backend/db #Path to DB schema files dbEventsPath=c:/postgresql_backend/events #Path to EVENTS DB Files dbAlertsPath=c:/postgresql_backend/alerts #Path to ALERTS DB Files dbBackupPath=c:/postgresql_backend/backups # Path to the backed up segment files
The winccoa_path/data/NGA/PostgreSQL/sql/db.windows.config /db.linux.config file must contain the paths to the database directories db, events, alerts, backups in the C:/postgresql_backend/ directory.
CAUTION: Only letters and numbers ([a-zA-Z0-9]) can be used for the content of the winccoa_path/data/NGA/PostgreSQL/sql/db.windows.config file. - Specify the
adminPassword
and thewinccoaPassword
- see Database Passwords (DB Admin & WinCC OA DB User). -
The
adminPassword
is the password that was used when the database was installed (see previous steps). If you change the winccoa password, the password must also be changed in NGA via - Run the winccoa_path/data/NGA/PostgreSQL/sql/create_database_windows.ps1 script for Windows to create the DB schema.
Note:
You can use the following command on a remote host to check if you can access the database:
psql -h <host> -p <port> -U <db user name> -c "SELECT pg_is_in_recovery();"
If the database is available, the result of the SELECT query is shown. Otherwise an error message is shown.
- Start the WinCC OA project and NGA via .
- Change the "Backend" for the alert group "ALERT" to PostgreSQL®.