Solved

Web Service Logging - How do I log oracle query text

Posted on 2011-02-15
4
869 Views
Last Modified: 2012-05-11
I have a web service that is returning an ORA-000942: table or view does not exist error.
I would like to find out which table it was querying.  How do I get the web service to either return the table name or else log the sql that it was using?

SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: ORA-00942: table or view does not exist. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> Oracle.DataAccess.Client.OracleException: ORA-00942: table or view does not exist
   at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
   at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
   at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
   at Oracle.DataAccess.Client.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior)
   --- End of inner exception stack trace ---

The web service was writting using visual studio .NET  (visual basic)
0
Comment
Question by:fowlow
  • 2
  • 2
4 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 34898403
Let me guess: You don't have access to the source code.

Are you allowed to decompile the code to extract the SQL?

If none of that is an option, you will likely need to turn on Oracle tracing.  This is usually troublesome to get set up but is possible.  

If you want to try this route:  What version of the Oracle client are you using?
0
 

Author Comment

by:fowlow
ID: 34898609
Actually I do have the source code and the software should be able to view the tables. 9I have confirmed this by logging into the database as the webservice user and confirming that it can read all the tables. However, I don't know which table is giving the ORA error.  
0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 34898718
The code must be referencing some table that user cannot see in the database in question.  

Does the code call any stored procedures/functions that might be the one actually generating the error?

Can you connect your development environment to the database generating the error and debug the code?
0
 

Author Comment

by:fowlow
ID: 34899733
I ran the code through the debugger and it stopped when trying to add an entry to a logging table.  That led me to determine that the database was missing a synonym to the table as it resided in a separate schema.

Issue resolved.
Thanks
Tim
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now