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.
1. Edit the postgresql.conf file on the server you wish to profile, modifying the shared_preload_libraries parameter as shown below:
3. Using the Query Tool or the psql command line interface, run the sql-profiler.sql script in the database specified as the Maintenance Database on the server you wish to profile. If you are using:
• To use the PEM Query Tool to run the script, highlight the name of the maintenance database in the Browser tree control, and navigate through the Tools menu to select Query tool. When the Query Tool opens, use the Open option on the Files menu to open a web browser and navigate to the sql-profiler.sql script. By default, the sql-profiler.sql script is located in the contrib folder, under your Postgres installation.When the script opens in the SQL Editor panel of the Query Tool, highlight the content of the script in the SQL Editor and select the Execute option from the Query menu (or click the Execute icon) 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 Advanced Server database on a Linux system:To access SQL Profiler functionality, highlight the name of the database in the PEM Browser tree control; navigate through the Management menu to the SQL Profiler pull-aside menu. Menu options allow you to manage your SQL traces:
• Select Create trace… to define a new trace (see Figure 5.7).
• Select Open trace… to open an existing trace.
• Select Delete trace(s)… to delete one or more traces.
• Select View scheduled trace(s)… to review a list of scheduled traces.For more information about using SQL Profiler, consult the online help text for SQL Profiler (accessed through the Help menu) or the PEM Getting Started Guide.