log switch frequency map seems to show incorrect results

The gv$log_history view has doubled information in it. Simply filtering on inst_id is not sufficient.

Even using the v$log_history view isn’t completely accurate without an extra condition.

Each instance uses its own thread to write to its own redo logs.

However, the v$ and gv$ views both expose all of the threads for all of the instances.

So, to really see values for a single instance, you must check the thread# column

SELECT …

from GV$log_history

where inst_id = thread#

and inst_id :instid

group by trunc(first_time), to_char(first_time, ‘Dy’)

Order by 1

or to get a global summary

SELECT …

from GV$log_history

where inst_id = thread#

group by trunc(first_time), to_char(first_time, ‘Dy’)

Order by 1

If you are connected to a RAC database (and I think you are, since Toad is using GV$log_history rather than V$log_history) then there should be a drop-down on the toolbar where you can choose thread. One of the choices is “Thread = Inst. ID”

hmmm, somehow I never saw that!

I’m curious though, when would you ever not want that selected?

I think I was just unclear on the relationship between inst_id and thread# and how it relates to rows in v$log. After a bit of research, I agree with you - I don’t see any reason why it should be an option. I’ll fix that.