Upgrading a SQL Profiler installation on a Windows host v8

If you're using SQL Profiler on a Windows host, Windows locks any files that executed or were loaded into memory. To release any locked files, you must stop the Postgres server before performing an upgrade.

On Windows, you can use the Services dialog box to control the service. To stop the service:

  1. In the Windows Control Panel, select System and Security > Administrative Tools.
  2. Double-click Services.
  3. In the Services dialog box, select the service name, and select Stop.

After stopping the Postgres Server:

  1. Delete the existing SQL Profiler query set on each node by invoking the uninstall-sql-profiler.sql script. By default, on a Windows host the script resides in the share\contrib directory under your EDB Postgres Advanced Server or PostgreSQL installation.

    You can use the following server-specific commands.

    For PostgreSQL:

    psql -f C:\Program Files\PostgreSQL\<x>\share\contrib\uninstall-sql-profiler.sql -d postgres -U postgres

    Where x is the version of PostgreSQL and -d specifies the name of the maintenance database.

    For EDB Postgres Advanced Server:

    psql -f C:\Program Files\edb\as<x>\share\contrib\uninstall-sql-profiler.sql -d edb -U enterprisedb

    Where x is the version of EDB Postgres Advanced Server and -d specifies the name of the maintenance database.

  2. Invoke the new SQL Profiler installer on each node you want to profile. Run the installer as an Administrator.

    For PostgreSQL:

    sqlprofiler-pg-<x>-<y>-windows-x64.exe

    Where x is the version of the PostgreSQL and y is the version of SQL Profiler, for example: sqlprofiler-pg-12-7.14.0-1-windows-x64.exe.

    For EDB Postgres Advanced Server:

    sqlprofiler-edb-as<x>-<y>-windows-x64.exe

    Where x is the version of EDB Postgres Advanced Server and y is the version of SQL Profiler, for example: sqlprofiler-edb-as12-7.14.0-1-windows-x64.exe.

    The SQL Profiler installer detects the existing SQL Profiler installation and upgrades it with the latest version of SQL Profiler.

  3. Run the sql-profiler.sql script file in the maintenance database.

    For PostgreSQL:

    psql -f C:\Program Files\PostgreSQL\<x>\share\contrib\sql-profiler.sql -d postgres -U postgres

    Where x is the version of PostgreSQL and -d specifies the name of the maintenance database.

    For EDB Postgres Advanced Server:

    psql -f C:\Program Files\edb\as<x>\share\contrib\sql-profiler.sql -d edb -U enterprisedb

    Where x is the version of EDB Postgres Advanced Server and -d specifies the name of the maintenance database.

  4. Then, restart the Postgres server to resume profiling the node from a PEM client.