Installing the SQL Profiler plugin v8

You must install the plugin on each server on which you want to use SQL Profiler. For example, if you have a host running PostgreSQL 10 and PostgreSQL 11, you must install two versions of the plugin, one for each server.

Install the plugin for PostgreSQL before configuring it. If you're using EDB Postgres Advanced Server, you can skip installation and go to Configuring SQL Profiler.

You can use the graphical installer to install any version of SQL Profiler on the Windows platform. On Linux, use an RPM package to install the SQL Profiler. For detailed information about configuring the EDB repository for your host platform, see the Installing on the PEM server .

Installing SQL Profiler on Windows

  1. To invoke the SQL Profiler graphical installer, assume Administrator privileges, navigate to the directory that contains the installer, and double-click the installer icon. The SQL Profiler installer welcomes you to the Setup Wizard.

  2. Select Next to continue to the license agreement.

  3. Review the license agreement before selecting the appropriate radio button and accepting the agreement. Select Next.

  4. Specify an alternative location for the installation directory, or accept the default location and select Next.

  5. The wizard is now ready to install the SQL Profiler plugin. Select Next.

When the installation is complete, the SQL Profiler plugin is ready to configure.

Installing SQL Profiler on RHEL/CentOS/OL

Note

You might need to add the sslutils package to your PostgreSQL database servers before installing SQL Profiler.

If you already configured the EDB repository on your system, you can use yum or dnf to install SQL Profiler.

For PostgreSQL,

yum install sqlprofiler_<X>

or

dnf install sqlprofiler_<X>

Where <X> is the version of your Postgres server.

For EDB Postgres Advanced Server,

yum install edb-as<X>-server-sqlprofiler

or

dnf install edb-as<X>-server-sqlprofiler

Where <X> is the version of your EDB Postgres Advanced Server installation.

For detailed information about configuring the EDB repository, see Installing the PEM server.

Installing SQL Profiler on Debian/Ubuntu

Note

You might need to add the sslutils package to your PostgreSQL database servers before installing SQL Profiler.

You can use an apt command to install SQL Profiler using DEB on Debian and Ubuntu. Assume root privileges.

For PostgreSQL,

apt install sqlprofiler_<X>

Where <X> is the version of your Postgres installation.

For EDB Postgres Advanced Server,

apt install edb-as<X>-server-sqlprofiler

Where <X> is the version of your EDB Postgres Advanced Server installation.

When the installation is complete, the SQL Profiler plugin is ready to configure.

Installing SQL Profiler on SLES

Note

You might need to add the sslutils package to your PostgreSQL database servers before installing SQL Profiler.

You can use an zypper command to install SQL Profiler on SLES. Assume root privileges.

For PostgreSQL,

zypper install sqlprofiler_<X>

Where <X> is the version of your Postgres server.

For EDB Postgres Advanced Server,

zypper install edb-as<X>-server-sqlprofiler

Where <X> is the version of your EDB Postgres Advanced Server installation.

When the installation is complete, the SQL Profiler plugin is ready to configure.

Configuring SQL Profiler

The SQL Profiler plugin isn't enabled when the installation process completes. This way you can restart the server at a convenient time. It also prevents the plugin from being loaded on systems where you don't need it all the time.

Note

If you 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.

To enable the plugin:

  1. Edit the postgresql.conf file on the server you want to profile, modifying the shared_preload_libraries parameter:

    shared_preload_libraries = '$libdir/sql-profiler'
  2. Restart the Postgres server.

  3. Using the Query tool or the psql command line interface, run the sql-profiler.sql script in the maintenance database on the server you want to profile. If you are using:

    • PostgreSQL, the default maintenance database is postgres.
    • EDB Postgres Advanced Server, the default maintenance database is edb.

    To use the PEM Query tool to run the script:

    1. Select the maintenance database in the Browser tree and select Tools > Query tool.
    2. When the Query tool opens, select File > Open and select the sql-profiler.sql script. By default, the sql-profiler.sql script is located in the contrib folder under your Postgres installation.
    3. When the script opens in the SQL Editor panel of the Query tool, select the content of the script in the SQL Editor and select Query > Execute to invoke the script and configure SQL Profiler.

    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 an EDB Postgres Advanced Server database on a Linux system:

    $ /usr/edb/as<x>/bin/psql -U postgres postgres < /usr/edb/as<x>/share/contrib/sql-profiler.sql

    Where <x> is the version of the EDB Postgres Advanced Server.

After configuring SQL Profiler, it's ready to use with all databases that reside on the server.

To access SQL Profiler functionality, select the monitored Server/database in the PEM Browser tree. Select Tools > Server > SQL Profiler. Then select:

  • Create trace to define a new trace.
  • Open trace to open an existing trace.
  • Delete trace(s) to delete one or more traces.
  • View scheduled trace(s) to review a list of scheduled traces.