简体   繁体   中英

How to join DBA_HIST_* tables with V$LOGMNR_CONTENTS table - Oracle DB

I have to collect some info in a both of redo log and dba_hist_* table (eg DBA_HIST_SQLTEXT, DBA_HIST_SQL_PLAN, DBA_SQLSET_PLANS). Because some info i needed not exists in redo log but exists in dba table.

I tried join via transaction id (binary field) but result seem wrong. I also can not find out sql id in redo log. How can i solve it, Thanks

There doesn't exist an exact mapping between a SQL statement and the redo generated.

You could get an approximation of redo impact on a SQL by SQL basis by looking at those SQL statements in V$SQL, V$SQLSTATS or equivalent historical views by looking at the ROWS_PROCESSED column where those statements are INSERT, UPDATE, DELETE or MERGE.

Also, looking at V$SEGMENT_STATISTICS for the 'db block changes' value will give you high redo segments, which you can tie back to SQL statements impacting those segments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM