Configuring SQL Profiler v7

The SQL Profiler plugin is not automatically enabled when the installation process completes. This allows you to restart the server at a convenient time, and prevents the plugin from being loaded unnecessarily on systems where it is not required on a continual basis.

Use the following steps to enable the plugin for each database monitored by SQL Profiler:

  1. Edit the postgresql.conf file on the server you wish to profile, modifying the shared_preload_libraries configuration parameter as shown below:

For Linux, shared_preload_libraries = '$libdir/sql-profiler'

For Windows, shared_preload_libraries = '$libdir/sql-profiler.dll'

  1. Create the functions used by SQL Profiler in your database. The SQL Profiler installation program places a SQL script (named sql-profiler.sql) in the share/contrib subdirectory of the main PostgreSQL installation directory. You must invoke this script on the maintenance database (specified when registering the server with PEM).

You can also use the psql command line to invoke the configuration script. The following command uses psql to invoke the sql-profiler.sql script on PostgreSQL Server database on a Linux system:

$ /usr/pgsql-x/bin/psql -U postgres postgres -f /usr/pgsql-x/share/contrib/sql-profiler.sql

  1. Stop and re-start the server for the changes to take effect.

Please note: if you have connected to the PEM server with the PEM client before configuring SQL Profiler, you must disconnect and reconnect with the server to enable SQL Profiler functionality.