Tracking Child Sqlid / Session Id executed By Plsql and Procedure using program_id
Its not easy to track and tune Child sql that are executed internally as part of plsql. Unfortunately Sqlid attached execution plan and Sql tuning advisor doesnt support on sqlid for plsql hence we need to identify Child sql that are executed internally as part of plsql and tune child sqlid . While this execution is in-progress, we could easily track the SQL that is currently executing along with its line no# with in the package. The PLSQL_ENTRY_OBJECT_ID and PLSQL_ENTRY_SUBPROGRAM_ID from V$SESSION would tell us the name of the package and method that is currently executing. Select owner,object_name,object_type,object_id from dba_objects where object_name in( 'MYPKG' ); OWNER OBJECT_NAM OBJECT_TYPE OBJECT_ID ---------- ---------- -------------------- ---------- ABDUL MYPKG PACKAGE BODY ...