fowlow
asked on
Web Service Logging - How do I log oracle query text
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.ORMSupportC lasses.ORM QueryExecu tionExcept ion: 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.O racleExcep tion: ORA-00942: table or view does not exist
at Oracle.DataAccess.Client.O racleExcep tion.Handl eErrorHelp er(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.O racleExcep tion.Handl eError(Int 32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
at Oracle.DataAccess.Client.O racleComma nd.Execute Reader(Boo lean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.DataAccess.Client.O racleComma nd.Execute DbDataRead er(Command Behavior behavior)
at System.Data.Common.DbComma nd.System. Data.IDbCo mmand.Exec uteReader( CommandBeh avior behavior)
at SD.LLBLGen.Pro.ORMSupportC lasses.Ret rievalQuer y.Execute( CommandBeh avior behavior)
--- End of inner exception stack trace ---
The web service was writting using visual studio .NET (visual basic)
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.ORMSupportC
at Oracle.DataAccess.Client.O
at Oracle.DataAccess.Client.O
at Oracle.DataAccess.Client.O
at Oracle.DataAccess.Client.O
at System.Data.Common.DbComma
at SD.LLBLGen.Pro.ORMSupportC
--- End of inner exception stack trace ---
The web service was writting using visual studio .NET (visual basic)
ASKER
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
Issue resolved.
Thanks
Tim
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?