I'm maintaining an home-brew web-based help-desk solution and we are experiencing an erroneous change in a db field under some circumstances. The code involved is quite frankly a mess, mixing different approaches to database access (the worst and most dangerous one being building sql strings through concatenation). A full-text search of the problematic field in the entire solution didn't help (the field only appeared in selects and in a single legitimate insert) so I can't even find the offending code.
Do you know a fast way to enable sql tracing either in Asp.Net or in Oracle (8) itself? (Is it possible to intercept sql commands through the OracleConnection object or something like that? That would make it possible to get a stack trace and find out the buggy code).
I've done some googling and I've found this one: ALTER SYSTEM SET sql_trace = true SCOPE=MEMORY;
but I'd like to know which is the better way to solve the problem (and maybe build up a simple sql logging mechanism without rewriting the application).