Require tool to trace the LInq Queries in Oracle - oracle

i am working entity framework with oracle data connection.
Can anyone suggest tool to get the LINQ queries executed in oracle.
I am looking similar tools like SQL profile in Oracle to trace and execute the queries.

I'm not aware of such a tool, but if you are using Entity Framework 6 and you can modify the application code, you can trace the queries by using the builtin logging.
For example, to output all queries to the console, you can use:
context.Database.Log = Console.Write;
For more details check https://msdn.microsoft.com/en-us/data/dn469464.aspx.

Related

Having trouble exporting my Application Insight data to SQL table?

I am viewing Applications Insight through Visual Studio 2017 View->Other Windows -.Applications Insight.
Can i export this data from Visual Studio to a sql table to perform more detailed queries ?
You don't need to import data into sql table since Application insights has its own table for these data. You can also perform more detailed queries on these data via the sql-like language kusto query language.
To do that, you need to go to azure portal -> your application insights -> Logs. In Logs, you can see some tables like traces, requests etc. -> then you can write your own query to do anything like you do in sql table:
By the way, there is no direct way to export these data into sql. If you want to do that, you should export these data into azure storage first(it's called Continuous Export), then use other methods to export them into sql. But I don't suggest it, people should always use the built-in logs table in application insights.

Tibco BW SQL Direct Activity. Is it possible to run multiple statements?

I use Tibco Business Works 5.14.
I am trying to run multiple SQL statements in one "SQL Direct" activity.
Tried with Oracle (ojdbc7_12.1.0.2.jar) and MySQL(mysql-connector-java-5.1.47.jar) jdbc drivers with no luck.
Example statements:
I see similar question in tibco community forum but no clear answer https://community-dev.tibco.com/questions/multiple-statements-sql-direct-activity
Is it possible to run multiple SQL statements using "SQL Direct Activity" in tibco BW5 ?
I have found the answer:
Running multiple statements in "SQL Direct" activity problem is not related to Tibco "Direct SQL" Activity itself. it's more related to jdbc driver implementation and database settings. 
Please see Multiple queries executed in java in single statement
for running multiple statements for example in MySQL you need to add 
?allowMultiQueries=true
 to connection string
String dbUrl = "jdbc:mysql:///test?allowMultiQueries=true";
Please note that setting ?allowMultiQueries=true also making your query vulnerable to various "SQL Injection" issues. Please see example SQL injection on INSERT

Oracle with IQueryable

I was having a bit of trouble figuring this out so I thought I'd ask explicity...
Does oracle's ODP.Net or ODT entity framework support IQueyable - ie. If I create simple paging or query in linq will it run the query on the database?
I'm roughly aware that there are commercial products that will work with oracle to do this - I see DevArt pop up quite a bit.
Thanks,
Sam
You can use NHibernate to run LINQ queries against Oracle database.
NHibernate uses it's "language" called HQL to talk to various databases. And they also built LINQ provider that creates HQL that is in the second phase sent to target DB.
After a bit more searching, it appears the ODP.Net will convert queries into SQL code, but ... poorly on occasion?
see
https://community.oracle.com/thread/2598619
for details & more relevant resources see
https://community.oracle.com/community/developer/english/oracle_database/windows_and_.net/odp.net/content
& enter tag "paging"
According to the last comment in the thread https://community.oracle.com/thread/2349719, linq actully generates the SQL.. interesting

How can I debug the SQL generated by EF5 during runtime?

So I am pretty new to EntityFramework, actualy in the POC stage right now, and one of the questions I am trying to answer is how can I visualize the query generated by EF through the debugger or other process attachable tool?
The case I am trying to solve is while trying to debug a QA, or production issue, the developer needs to be able to attach to the process through the remote debugger, and needs to visualize the query created by EF to see if it's framed in the most effective manner.
The same can be said during development, where I need to be able to visualize the query made by EF.
You can either:
Use Sql Server Management Studio Query Analyzer to see the traffic that goes to the database (probably the least invasive)
Attach VS to your process and use IntelliTrace is should show commands sent to the database
Try using EF Tracing provider (http://code.msdn.microsoft.com/EFProviderWrappers)
For queries you can do .ToTraceString() on ObjectQuery object and .ToString() on DbQuery object when debugging.
EDIT
EF6 contains a new feature that allows you log the traffic to the database

How to use Toad to trace SQL

How to use Toad to trace what sql are being executed by my application? All I want to do is trace what SQL / PL/SQL procedures are being executed by my application and what parameters are being passed?
You can not use TOAD to trace SQL fired by external application, but you can utilize session browser to see what queries are being executed on session basis.There is also oracle utility called tkprof which can be used to profile SQL.Also take a look at this :
Oracle: is there a tool to trace queries, like Profiler for sql server?
In the commercial version of Toad you can use the SQL Tracker which is found in the menu option: Database > Monitor > SQL Tracker. If you don't have that as part of your Toad then they also offer SQL Monitor for free. A blog about it is here.

Resources