/
How to Access the Security Server Postgres Database?

How to Access the Security Server Postgres Database?

How to access the Security Server Postgres database?

Security Server includes a Postgres database instance that contains three databases:

  • serverconf - Security Server configuration

  • messagelog - signed and time-stamped messages processed by the Security Server

  • op-monitor - operational monitoring data.

You can find the database connection details from the /etc/xroad/db.properties configuration file.

Step-by-step guide

The Security Server's Postgres database can be accessed following the steps below.

  1. Connect to the Security Server using SSH.

  2. Switch to the postgres user using sudo.

    $ sudo su - postgres
  3. List existing databases.

    $ psql -l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges ------------+-----------------+----------+-------------+-------------+----------------------- messagelog | messagelog | UTF8 | en_US.UTF-8 | en_US.UTF-8 | op-monitor | opmonitor_admin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | serverconf | serverconf | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres + | | | | | postgres=CTc/postgres
  4. Log in to the messagelog database. You can find the database password from the /etc/xroad/db.properties configuration file.

    $ psql "host=127.0.0.1 port=5432 dbname=messagelog user=messagelog password=<PASSWORD>" psql (12.16 (Ubuntu 12.16-0ubuntu0.20.04.1)) SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off) Type "help" for help.
  5. List tables in the messagelog database.

  6. Show the structure of the logrecord table.

  7. Query the number of rows in the logrecord table.

  8. Query the last ten rows in the logrecord table.

  9. Query the timestamps of a request / response message pair.

  10. Exit from Postgres.

Related articles







Related content

How to Access the Message Body in the Message Log Database and Archive Files?
How to Access the Message Body in the Message Log Database and Archive Files?
Read with this
How to Access the Central Server Postgres Database?
How to Access the Central Server Postgres Database?
More like this
How to Empty the OCSP Cache on the Security Server?
How to Empty the OCSP Cache on the Security Server?
Read with this
Manual Security Server Database Schema Update When Upgrading to Version 6.24.0
Manual Security Server Database Schema Update When Upgrading to Version 6.24.0
More like this
How to Test That the Security Server Is Working After Completing Installation and Configuration?
How to Test That the Security Server Is Working After Completing Installation and Configuration?
Read with this
Security Server Ubuntu 18.04 to 20.04 In-place Upgrade.
Security Server Ubuntu 18.04 to 20.04 In-place Upgrade.
More like this