We have a large enterprise consisting of many apps both old and new backed by Oracle 10G. When blocking sessions or deadlocks occur and we get trace reports it would be super handy to be able to have embedded some details in the sql so that we know both what app, and specifically where it was executed from. In addition to helping speed up the resolution time, it can help us find places where business processes were stepping on each other. We have a few thoughts on how this could be achieved, but I am curious if this is already a solved problem. Any thoughts or details on any successful (or otherwise) attempts would be appreciated.
Share
You can tag chunks of SQL being executed via the Oracle DBMS_APPLICATION_INFO package. This works in any application language, works within the database engine itself, and does not clutter your SQL statements with comments (smart comments are evil anyway). More importantly, Oracle’s various tools recognize the data and help you use it when troubleshooting or tuning.