Installing SQL Profiler

SQL Profiler allows a database superuser to locate and optimize poorly-running SQL code. Users of Microsoft SQL Server’s Profiler will find PEM’s SQL Profiler very similar in operation and capabilities. SQL Profiler is installed with each Advanced Server instance; if you are using PostgreSQL, you must download the SQL Profiler installer, and install the SQL Profiler product into each managed database instance you wish to profile.

For each database monitored by SQL Profiler, you must:

  1. Edit the postgresql.conf file; you must include the SQL Profiler library in the shared_preload_libraries configuration parameter.
For Linux installations, the parameter value should include:
$libdir/sql-profiler
on Windows, the parameter value should include:
$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/postgresql/contrib subdirectory of the main PostgreSQL installation directory on Linux systems. On Windows systems, this script is located in the share subdirectory. You must invoke this script on the maintenance database (specified when registering the server with PEM).
  2. 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.