How to find sql query in weblogic - oracle

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.

Related

Oracle report about executed queries for a specific user before TDE activation

I need to run a performance comparison before activating Oracle TDE on our database (12c).
My idea was to monitor executed queries for a specific user (Java EE App Server) and then replay these queries on a cloned Oracle TDE instance to compare response times.
We found the Oracle AWR feature, however, in this report over 90% of the queries are "system" queries which were not triggered by the App Server's JDBC driver(, but by internal oracle jobs/optimizations?).
Is there some functionality to restrict AWR monitoring to only use queries of a specific user/driver or is there another functionality I could use for conducting my performance tests?
Thanks!
Oracle's Automated Workload Repository (AWR) captures all database activity. You have some flexibility in the depth of statistics it captures, but you can't filter the way you are asking for. When you product an AWR report, you will get everything the database performed, and specifically for the SQL data, you'll get the top or highest load SQL's. There are some additional thresholds you can set to get more SQL in the report, so instead of the top-10, you can get the top-50. This can be set as a default or per AWR report.
More can be found here
Oracle workload repository package

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

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

Save data from database

I have created an application with internal database LightSwitch..
Now I want to publish my application and I want to publish also data of my internal database..How can I do?
for example : I have an application Fantacalcio and I created some players in my internal database of lightswitch..now when I publish my application and I install it in my pc there are no data in my application.. I want that when I install my application there must be players that I have created before..
You can do it programmatically in something like Application_Initialize, or in a SQL script.
LS has no "built-in" way to pre-populate data, so it's a matter of choosing a workaround.
One possible way is to do the following:
Attach the lightswitch internal database to SQL server
Export all the data into a SQL script, here are the instructions
After you have the sql script (mostly INSERT statements), then run
the script on your designated database.
The exact same data should now be populated there.

What should be approach?

Try to be more clear, I'm in lack of ideas in this problem, even it sounds like a classic.
My application is running on weblogic 10.3.3 application server, and for database I am using Oracle database 11g. My problem is that there is table in db, let's say "user.", there is column, let's say "columnA", in this table. This table is updating by some module of application.
What I want if when value of column is "abc.", then I have to show alert to console(IP). {IP can be retrieved from DB as it is configured in DB. this ip will be other linux system other than linux machine where oracle database is installed.} Updating is continuously done on my table from module of application. Please tell me from where should I start?, what should I read. I am not able to understand what should be approach. Any help is much appreciated.
A trigger on the table can call UTL_HTTP to communicate with another machine (eg call a RESTful API).
The architectural questions are :
This will happen PRIOR to the commit so you may get false alerts if a change is rolled back
If you wait for a response, it will slow the system down.
What do you do if you get an non-standard response (eg the other server isn't available)

Monitor and change SQL queries with SQL Server 2000

I have a database upgrade tool that is misbehaving. I would like to catch one of the queries it sends to the database and change it before it is executed.
The tool connects via ODBC.
The tool and the SQL Server are on the same Windows 2003 Server box.
Any ideas?
EDIT: (More info)
When the tool runs it dies on step 12 out of 100. It issues some bad SQL intended to create a view. I need to suppress the error message or correct the SQL before it is executed. I can't just create the view because the first thing it does it drop the view. Even then it would error because the view would already exist.
Certainly - use the SQL Profiler to intercept and record the query.
Very useful little tool that...

Resources