Is there a way to just log the SQL statements to a saperate file?
Yes. As mentioned in the option 3 above, you can use a third party utility to write all the SQL statements sent to the database to a saperate file. One such utility is P6SPY. You can download this from http://www.p6spy.com. Follow these steps to install and configure P6SPY. 1. Extract the p6spy-install.jar file. The p6spy-install.jar file contains p6spy.jar and spy.properties. 2. Deploy p6spy.jar into the partition as a library. (This requires a restart of the partition) 3. Copy spy.properties to BES-INSTALL/classes/patches directory (You can create the directory in case it does not exist) 4. Edit the dar file (or jndi-definitions.xml file) to change the driver settings to use P6SPY driver.