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!

Get list of SQL_ID between two Snapshot Id's

I have two Snap Id (Begin snapshot time- End snapshot time) query- SELECT snap_id FROM dba_hist_snapshot;
I want to get a list of all SQL_Ids executed between the two snapshots.
Is there any way to get the list of all SQL Ids?
test1.pngIn the Screenshot , I have a text field for SQL_ID. I want to make it a combo box, with values as SQL id's based on the begin and end snapshots.

Comments

Hemendra.Singh

Hi @user-eoyhx-oracle,

Please use the below data dictionary view to get the required data.

DBA_HIST_SQLSTAT - for sql_id only
Join DBA_HIST_SQLSTAT with DBA_HIST_SQLTEXT - for sql_id + sql_text

Please let me know if you have any further questions related to this.

Thanks,

Hemendra Singh

1 - 1

Post Details

Added on Jan 10 2023
1 comment
1,639 views