Monday, June 18, 2012

Weblogic 11 trace and log SQL statements on a Datasource

gone are the days of P6Spy...

Gone are the days of WLSpy : "The wlspy.jar has been deprecated"

Now there is JDBCSpy:


JDBCSpy in action

Official doc:
http://docs.oracle.com/cd/E21764_01/web.1111/e13753/spy.htm

also this article is interesting


one day also JDBCSpy will die.... and se superseded by something else ... nothing lasts forever, apart human stupidity...

I tried to make SQLSpy work, no way.... maybe it works only with WebLogic drivers, and not Oracle drivers.
I try adding the ";spyAttributes=(log=(file)acmespy.log)" string to the URL, but it fails with a

java.sql.SQLRecoverableException: IO Error: NL Exception was generated
Caused by: oracle.net.ns.NetException: NL Exception was generated
at oracle.net.resolver.AddrResolution.resolveAddrTree(AddrResolution.java:614)

So I use the weblogic debug flag -Dweblogic.debug.DebugJDBCSQL or set it from the WebLogic console in the server/debug/weblogic/jdbc/sql/DebugJDBCSQL

and you get this


####<Jun 21, 2012 6:46:18 PM CEST> <Debug> <JDBCSQL> <hqchnesoa200> <osbpl1ms1> <[STUCK] ExecuteThread: '6' for queue: 'weblogic.kern
el.Default (self-tuning)'> <<WLS Kernel>> <> <11d1def534ea1be0:-115b5766:1380fddf0f3:-8000-0000000000000234> <1340297178066> <BEA-000
000> <[[weblogic.jdbc.wrapper.JTAConnection_weblogic_jdbc_wrapper_XAConnection_oracle_jdbc_driver_LogicalConnection-SOAXADataSource-1
830, oracle.jdbc.driver.LogicalConnection@5249d560]] prepareStatement(DELETE FROM FILEADAPTER_IN WHERE FILE_PROCESSED='2' AND FILE_R
EADONLY='N' AND ROOT_DIRECTORY=?)>



No comments: