Weblogic server: Profiling JDBC calls on a DataSource from an weblogic application - jdbc

We are running applications on weblogic server. We have a requirement in which we want to monitor jdbc calls made on a data source. We only want to collect time taken for each sql to execute and number of times a sql is fired. I also want to collect this information per user session.
There are a few utilties on the web like weblogic jdbc spy, log4jdbc, etc. But they all required additional setup on the data source and provide output on a separate logging file which does not contain per session output as such. Is it possible to create another weblogic application that listens on a given data source and record all the sql and the timings per session? Please provide any pointers that you have.
TIA,
Siva Rajesh

Oracle JRockit Flight Recorder can be answer for you. I'm using him. Just make a record in defined time and then analyze gathered jfr file with Oracle JRockit Mission Control.
Links:
Oracle JRockit Flight Recorder manual
Oracle JRockit Mission Control
Or you can find your answer with parameter -Doracle.jdbc.Trace=true -Djava.util.logging.config.file=/jdbc/demo/OracleLog.properties

Related

Neo4j to Oracle real time data sync

In one of the use cases in my application there is a requirement to publish neo4j transaction data to oracle database in real time. I did google on it, but couldn't find a tool or plug-in which can help. Everywhere on internet talks about rdbms to neo4j sync. So I am planning to do this by manually invoking jdbc commands.
Can you please suggest something?
Had to write my own jdbc code.

How can I read a .dbf file with wso2 Data Services Server?

the documentation of WSO2 Data services server say you can read any database with a JDBC driver, and I found that there are some JDBC libraries for .DBF files.
DSS documentation: http://wso2.com/products/data-services-server/
JDBC for DBF files: http://www.csv-jdbc.com/stels_dbf_jdbc.htm
Someone has already done or did something similar?
I would appreciate your help
Yes, WSO2 DSS supports any RDBMS datasource type, provided a compatible driver is copied to the product. You can follow the below steps.
You can add the JDBC driver to the $DSS_HOME/repository/component/lib folder and start the server.
Create a dataservice by following the this doc
Add an RDBMS type datasource, as DBF is not listed in the pre-defined datasource types, select 'Generic' and give the driver class name, connection url, username and password according to the DBF specified
Add query and then an operation. Our official documentation has all the necessary steps.
Please note that, we have not tested with this driver, therefore, to use in a production environment, a comprehensive testing cycle will be needed (including load tests, long running tests .. etc).

How to find sql query in weblogic

I support an application whose UI is built on weblogic server. I need to know the sql query fired in the database whenever any action is performed on UI. Since there a lot of users hence I need to know is there any specific action through which I can identify it ?
Your managed server logs should give you queries run through a PreparedStatement. Any database will give you auditing capabilities so you can track what SQL was run, origins and parameters passed.

Microsoft Enterprise Logging Block with Entity Framework asks for WriteLog procedure

I have a WCF service that uses Microsoft Enterprise Library Logging to log some messages to the Event Log. That works just fine.
The problem is that i want to log some messages to a table in an Oracle database. I am using the Entity Framework to communicate with that Oracle database.
The next step is a right click on the 'web.config' and choose the option 'Edit Enterprise Configuration'. I get the 'Enterprise Library Configuration' editor. In there i am trying to set the Logging Settings so that it also logs to the database, but when i add a database trace listener it´s asking me to fill in a procedure name. Do i have to add a procedure name to fill the table in Oracle? The msdn tells me to run the script that create an MSSQL database 'Logging' and some tables. But i don't have an MSSQL server, i have an Oracle server. And i don't want to use a seperate logging database, but save the logs to a single table.
Can anybody help me with this?
Kind regards
The Enterprise Library Database Trace Listener uses 2 stored procedures to write to the database: Add Category Procedure and Write To Log Procedure.
There is a SQL Server script to create the tables and stored procedures. This would have to be ported to Oracle.
Unfortunately, it looks like this does not work as easily as you would hope. See the blog post, Enterprise Library Logging to Oracle Database (this is based on EntLib 3, I believe) and the work item Cannot log to oracle Database using logging blocks for a description of some of the issues as well as some downloads to help.

HSQLDB Manager?

I have tried SQLite in Java, but the speed is slow due to the JDBC driver. Then I tried HSQLDB and thought the speed is good, but I cannot find a good management tool for HSQLDB such as phpMyAdmin for MySQL or SQLite Manager for SQLite.
I'd like to use the manager tool to prepare the test data for unit tests, or use the manager tool to navigate the data after doing some small experiments.
Is there any good tool?
Here are a couple other suggestions you might checkout:
Squirrel SQL http://squirrel-sql.sourceforge.net/
Execute Query http://executequery.org/
Razor SQL (paid) http://www.razorsql.com/
Razor has the best feature set, but is paid. The others are good at different things and worth checking into.
This would only have meaning if you are running in HSQLDB server mode. If you are running in memory or file mode, then you either can't access the DB from another process or doing so would lock it.
In Server mode you could use any universal client. JDBC driver is the hsqldb.jar itself.
Actually HSQL brings its own management tool (which is not super). See http://hsqldb.org/doc/guide/apf.html
I've used Squirrel SQL. It's a universal client for any JDBC database.
See: http://squirrel-sql.sourceforge.net/

Resources