Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Track an SQL_ID to the code that executed it

682560Aug 21 2024

This post is from 2009, and related, but not really helpful with resolution: https://forums.oracle.com/ords/apexds/post/can-you-capture-sql-id-from-the-jdbc-connection-0611

We have a large monolithic Oracle instance that is accessed by many different clients/microservices. We have issues at times where a query is identified by an SQL_ID as problematic for some reason.

It would be INCREDIBLY useful and much more efficient in the process of diagnosing issues if there was a way to log the SQL_ID from the client/microservice. Once the problematic SQL_ID was identified, it could be found in the logs, which would immediately lead the person doing the research to the client(s)/microservice(s) that executed the code.

Has anyone had success with an approach for this? In our case, we are using configuration driven services (SpringBoot). Is it possible (without a performance impact) to get the SQL_ID after (or even before) an execution of a statement/stored procedure?

Ideally, I would like to have some way to get the SQL_ID from the ResultSetMetaData or the OracleResultSetMetaData.

Comments
Post Details
Added on Aug 21 2024
1 comment
245 views