Part 3 : Output Debug SQL statements on a Managed Server on a Production Weblogic 10.3 Cluster

Printer-friendly versionPDF version

So if you have already read my debugging adventures on a production clone Weblogic server part 1 and part 2, this can be called the part 3 of that series.

So my next problem was to look at sql's being generated by my ADF application. I knew ADF could also output sql but there is too much noise in there. And I remembered a colleague saying weblogic could also spew out sql on the data source. So it was time to test that out.

Turns out there are 2 ways to do this. I opted for the weblogic console method, which I will mention next, since I hope it would require no restart, but alas it in the end asked for one. So I lost 20 mins or so, thats the amount of time my managed server approx needs to come up. Anyways I mention this solution first but would recommend the 2nd solution with the java parameters as more simpler to pursue in the future.

Option 1 to debug Sql

This is the more visual route. Although the visual part fails in Oracle guides. So hope this helps. But since a restart was required at the end of this option. I felt it was useless. So to save time just skip to Option 2 below. Otherwise continue.

So your need to first open your Managed Server that you want to debug and get sql output from. From there just click the "Domain Structure" tree on left hand side and expand to "Environments->Servers->YourManagedServer". Than do the following 2 steps.

  • Access the top level "Logging" Tab and change the log level to debug.

Weblogic Logging Level Change

  • Access the the top level "Debug" Tab and activate the weblogic debug option "DebugJDBCSQL" 

  Weblogic debug sql statements option

Option 2 to debug Sql

This is the more cleaner option. As mentioned in part 1 of adding debug options via the weblogic console option, just also add the following options the same way :

So your need to first open your Managed Server that you want to debug and get sql output from. From there just click the "Domain Structure" tree on left hand side and expand to "Environments->Servers->YourManagedServer". Than open the "Configurations" tab and the sub-tab "Server Start". Than add the following option in arguments text field:

-Dweblogic.debug.DebugJDBCSQL=true 
-Dweblogic.log.StdoutSeverity=Debug

Than just save and activate your changes for that managed server. View your logs and your done.

References

Weblogic documentation here (Section: Enable Debugging ) (11 Aug, 2016).
 

Top level category:

Add new comment