P6spy combined with SQL profiler Configuration
P6spy is a dynamic monitoring framework for database access. It has been very mature for a long time. p6spy simulates a standard JDBC driver and acts as a proxy for the real underlying JDBC driver. That is to say, we only need to configure the JDBC driver used in the system as the p6spy driver, and configure the realdriver in the p6spy configuration as the actual JDBC driver, so that we can use its performance monitoring function.
Sqlprofiler is the peripheral resource of p6spy, and p6spy is recorded using log files, which looks troublesome. sqlprofiler provides a graphical monitoring interface for us to monitor the SQL Execution Process in real time, calculate and optimize the execution results.
I. graphical monitoring and use of p6spy in combination with SQL profiler
1. Install the SQL profiler package from the http://www.jahia.net/download;
2. Put p6spy. jar and sqlprofiler. jar in classpath. If it is a Web application, put it in yourwebapp/WEB-INF/lib/directory;
3, put the spy. properties to the classes directory, if webapp is placed in yourwebapp/WEB-INF/classess/directory, and LIB/directory, two places. (Special Note !!!!)
4. You do not need to change the driver name com. p6spy. Engine. Spy. p6spydriver of your program;
5. Open the spy. properties file and change the realdriver value to the database driver name of your program;
6. run Java-jar sqlprofiler. jar to start SQL profiler and check the startup interface;
7. Start your application or server and process normal system requests;
8. The results are displayed and analyzed on the SQL profiler graphical interface.
You can also click the Save button to export the index script recommended for database optimization.