准备,
下载“p6spy-install.zip”和“IronTrackSQL.zip”。
配置
将p6spy.jar和irontracksql.jar,log4j-1.2.8.jar,spy.properties复制到C:/bea/weblogic81/server/ext下
将IronTrackSql目录下的lib目录下的所有文件复制到%JAVA_HOME%/lib/ext下
修改spy.properties将
realdriver=???改为
realdriver=oracle.jdbc.driver.OracleDriver
修改C:/bea/user_projects/domains/mydomain下的startWebLogic.cmd,在classpath中%CLASSPATH%前增加下列语句
%WL_HOME%/server/ext/irontracksql.jar;%WL_HOME%/server/ext/p6spy.jar;%WL_HOME%/server/ext;
如果用exlipse来调试则需在@REM Initialize the common environment.后面增加
set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n
将最后面行改为如下面:(%DEBUG_OPTS%为新增的)
%JAVA_HOME%/bin/java %DEBUG_OPTS% %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy="%WL_HOME%/server/lib/weblogic.policy" weblogic.Server
先启动IronTrackSql用下面的命令行:
cd C:/bea/weblogic81/server/ext
java -jar irontracksql.jar
再启动weblogic服务器就可以监控sql了