TryCatchFinally.net Some SQL, some .NET, and whatever else

23Nov/150

Viewing Supplemental Logging status in your Oracle database

Viewing the status of supplemental logging on all of our Oracle tables is done via the all_log_groups table, but it's not in an easy-to-use format and needs to be pivoted (and it only shows you which tables have logging of some kind, which makes it difficult to tell which tables don't have anything). I've done that below to provide an easier view of the status of supplemental logging on all tables, regardless of their current status:

  select t.owner, t.table_name,
         max(case when lg.log_group_type = 'USER LOG GROUP'      then lg.always end ) as "User Log Group",
         max(case when lg.log_group_type = 'ALL COLUMN LOGGING'  then lg.always end ) as "All Column",
         max(case when lg.log_group_type = 'PRIMARY KEY LOGGING' then lg.always end ) as "Primary Key",
         max(case when lg.log_group_type = 'UNIQUE KEY LOGGING'  then lg.always end ) as "Unique Key",
         max(case when lg.log_group_type = 'FOREIGN KEY LOGGING' then lg.always end ) as "Foreign Key"
    from dba_tables t
    left
    join all_log_groups lg
      on t.owner = lg.owner
     and t.table_name = lg.table_name
   where t.owner = 'Table Owner'
   group by t.owner, t.table_name
   order by t.table_name

In the recent spat of Goldengate troubleshooting, I've had to check these values a number of times and I hope this query is useful to others (since I couldn't find a good example online that made this information easy to view).

Please let me know below if you have any issues!

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

Why ask?

No trackbacks yet.