暂无图片
暂无图片
2
暂无图片
暂无图片
暂无图片

Discovering empty DBA_HIST_ tables in different oracle versions

原创 Quanwen Zhao 2021-12-11
4558

Table of Contents

Preface

Perhaps anybody else is wondering why there has no "in Last 24 Hours", "in Last 7 Days", "in Last 31 Days" and "Custom Time Period" in my previous two blog notes (the former is "How to Visualize Active Sessions Per Activity Class" in Chinese and the latter is "How to Visualize Active Sessions Per Wait Class" in English) have been published on modb recently. Here's a general solution that I often learn something new from experts in the virtual world.

A couple of days ago I respectively posted a same thread about "Why dba_hist_waitclassmet_history has 0 line?" on Oracle-L with FreeLists and AskTOM for solving my confusion from here and here. In the meantime I'm extremely glad to receive awesome replies from several Oracle experts (such as, Jonathan Lewis, Kyle Hailey and Connor McDonald). Hence quoted their fantastic response as below (based on the order of their names mentioned previously):

It must be a deliberate coding decision, and there may be a hidden parameter (or call to an internal package) that changes the way Oracle access the relevant x$, but if you trace the snapshot code you can see the SQL statement that ought to populate the relevant wrh$ from the x$ table, and then see that nothing arrives there.

Yeah, I recall empty dba_hist_waitclassmet_history being confusing.

I believe dba_hist_waitclassmet_history is just for alerting entries when some limit has been breached.
It's been a long time since I've looked at this stuff.


  • Statistics
    • DBA_HIST_SYSMETRIC_SUMMARY – max, min, avg standard deviation
    • DBA_HIST_SYSSTAT (cumulative)
    • DBA_HIST_SYSMETRIC_HISTORY (alerts)
  • Waits
    • WAITCLASSMETRIC_HISTORY (alerts)
    • DBA_HIST_SYSTEM_EVENT (cumulative)
  • File IO
    • DBA_HIST_FILEMETRIC_HISTORY (alerts)
    • DBA_HIST_FILESTATXS (cumulative)

Digging into the view definition, you'll see it sources its data from WRH$_WAITCLASSMETRIC_HISTORY.

During an AWR capture, WRH$_WAITCLASSMETRIC_HISTORY is populated from x$kewmevmv

If we then dig into v$fixed_view_definition, you can see that this X$ table is the source for V$EVENTMETRIC and if we check the docs for that:

"V$EVENTMETRIC displays values of wait event metrics for the most recent 60-second interval."


So I'd imagine unless you're running hard *right now*, the rows will most likely be zero.

Of course, the following two threads are my response on Oracle-L with FreeLists and AskTOM separately.

-- I called DBMS_METADATA.GET_DDL() to check the view defined.

SET VERIFY   OFF
SET LONG     1000000000
SET LINESIZE 200
SET PAGESIZE 200
 
PROMPT =======================
PROMPT  Running on SYS schema
PROMPT =======================

SELECT DBMS_METADATA.get_ddl(UPPER('&object_type'), UPPER('&object_name'), UPPER('&owner_name')) FROM dual
/

Enter value for object_type: view
Enter value for object_name: dba_hist_waitclassmet_history
Enter value for owner_name: sys

DBMS_METADATA.GET_DDL(UPPER('VIEW'),UPPER('DBA_HIST_WAITCLASSMET_HISTORY'),UPPER
--------------------------------------------------------------------------------

  CREATE OR REPLACE FORCE VIEW "SYS"."DBA_HIST_WAITCLASSMET_HISTORY" ("SNAP_ID", "DBID", "INSTANCE_NUMBER", "WAIT_CLASS
_ID", "WAIT_CLASS", "BEGIN_TIME", "END_TIME", "INTSIZE", "GROUP_ID", "AVERAGE_WA
ITER_COUNT", "DBTIME_IN_WAIT", "TIME_WAITED", "WAIT_COUNT", "TIME_WAITED_FG", "W
AIT_COUNT_FG") AS
  select em.snap_id, em.dbid, em.instance_number,
       em.wait_class_id, wn.wait_class, begin_time, end_time, intsize,
       group_id, average_waiter_count, dbtime_in_wait,
       time_waited, wait_count, time_waited_fg, wait_count_fg
  from wrm$_snapshot sn, WRH$_WAITCLASSMETRIC_HISTORY em,
       (select wait_class_id, wait_class from wrh$_event_name
        group by wait_class_id, wait_class) wn
  where     em.wait_class_id   = wn.wait_class_id
        and sn.snap_id         = em.snap_id
        and sn.dbid            = em.dbid
        and sn.instance_number = em.instance_number
        and sn.status          = 0

SQL> SELECT COUNT(*) FROM WRH$_WAITCLASSMETRIC_HISTORY;

  COUNT(*)
----------
         0
-- Thank you, Connor!

SET LINESIZE 200

COLUMN view_name       FORMAT a30
COLUMN view_definition FORMAT a120

SELECT view_name
     , view_definition
FROM v$fixed_view_definition
WHERE view_definition LIKE '%x$kewmevmv%'
;

VIEW_NAME                      VIEW_DEFINITION
------------------------------ ------------------------------------------------------------------------------------------------------------------------
GV$EVENTMETRIC                 SELECT inst_id, begtime, endtime, intsize_csec,            wait#, wait_id, nsess_wait, time_waited, wait_count,
                                  time_waited_fg, wait_count_fg          FROM   x$kewmevmv          WHERE flag1 = 1 AND GROUPID = 0

GV$WAITCLASSMETRIC             SELECT inst_id, begtime, endtime, intsize_csec,            wait#, wait_id, average_waiter_count,            dbtime_in_wa
                               it, time_waited, wait_count,            time_waited_fg, wait_count_fg          FROM   x$kewmevmv          WHERE flag1 =
                               1 AND GROUPID = 1

GV$WAITCLASSMETRIC_HISTORY     SELECT inst_id, begtime, endtime, intsize_csec,            wait#, wait_id, average_waiter_count,            dbtime_in_wa
                               it, time_waited, wait_count,            time_waited_fg, wait_count_fg          FROM   x$kewmevmv          WHERE GROUPID
                               = 1

[Back to TOC]

At this moment I assume that we've known the real reason why dba_hist_waitclassmet_history has 0 line. So we can't stop here and consider finding out how many empty "DBA_HIST_" tables in oracle database. Now we'll use the following two type of approach to exactly discover all of empty DBA_HIST_ tables in different oracle versions.

Discovering empty DBA_HIST_ tables

Using explicit cursor and dynamic SQL to discover

Here's my anonymous pl/sql code block as below. Note: running it on SYS schema by SQL*Plus.
SET SERVEROUTPUT ON;

DECLARE
  v_sql   VARCHAR2(200);
  tab_num NUMBER;
  CURSOR cur_dba_hist IS
  SELECT table_name
  FROM dict
  WHERE table_name LIKE '%DBA_HIST_%'
  ORDER BY 1;
BEGIN
  FOR v_dba_hist IN cur_dba_hist
  LOOP
    v_sql := 'SELECT COUNT(*) INTO tab_num FROM ' || v_dba_hist.table_name;
    EXECUTE IMMEDIATE v_sql;
    IF tab_num = 0 THEN
      DBMS_OUTPUT.PUT_LINE('The lines of ' || v_dba_hist.table_name || ' has been returned 0.');
    END IF;
  END LOOP;
END;
/

DECLARE
*
ERROR at line 1:
ORA-00905: missing keyword
ORA-06512: at line 15

As you can see from the above line 15 (EXECUTE IMMEDIATE v_sql;) oracle prompts missing keyword, I've got confused and taken a bit of time troubleshooting the weird error but fortunately Dominic Brooks pointed out the possible syntax error between line 14 and 15 for assignment to v_sql and execute immediate v_sql on my oracle-l thread. Here's the correct syntax code like this (due to a little longer, so omitted the rest of pl/sql code):

......
    v_sql := 'SELECT COUNT(*) FROM ' || v_dba_hist.table_name;
    EXECUTE IMMEDIATE v_sql INTO tab_num;
......

Its executing outcome is as follows.

The lines of DBA_HIST_BASELINE_TEMPLATE has been returned 0.
The lines of DBA_HIST_CLUSTER_INTERCON has been returned 0.
The lines of DBA_HIST_COLORED_SQL has been returned 0.
The lines of DBA_HIST_CR_BLOCK_SERVER has been returned 0.
The lines of DBA_HIST_CURRENT_BLOCK_SERVER has been returned 0.
The lines of DBA_HIST_DLM_MISC has been returned 0.
The lines of DBA_HIST_DYN_REMASTER_STATS has been returned 0.
The lines of DBA_HIST_FILEMETRIC_HISTORY has been returned 0.
The lines of DBA_HIST_IC_CLIENT_STATS has been returned 0.
The lines of DBA_HIST_IC_DEVICE_STATS has been returned 0.
The lines of DBA_HIST_INST_CACHE_TRANSFER has been returned 0.
The lines of DBA_HIST_INTERCONNECT_PINGS has been returned 0.
The lines of DBA_HIST_LATCH_CHILDREN has been returned 0.
The lines of DBA_HIST_LATCH_PARENT has been returned 0.
The lines of DBA_HIST_MEMORY_RESIZE_OPS has been returned 0.
The lines of DBA_HIST_MEMORY_TARGET_ADVICE has been returned 0.
The lines of DBA_HIST_MTTR_TARGET_ADVICE has been returned 0.
The lines of DBA_HIST_PERSISTENT_QUEUES has been returned 0.
The lines of DBA_HIST_PERSISTENT_SUBS has been returned 0.
The lines of DBA_HIST_SESSMETRIC_HISTORY has been returned 0.
The lines of DBA_HIST_SNAP_ERROR has been returned 0.
The lines of DBA_HIST_STREAMS_APPLY_SUM has been returned 0.
The lines of DBA_HIST_STREAMS_CAPTURE has been returned 0.
The lines of DBA_HIST_WAITCLASSMET_HISTORY has been returned 0.

PL/SQL procedure successfully completed.

It looks like to show an ugly/unformatted output in the prior content. Let's slightly adjust pl/sql code snippet. Taking a look at the following new section (adding the extra output).

SET SERVEROUTPUT ON;
SET FEEDBACK OFF;

DECLARE
  v_sql    VARCHAR2(200);
  tab_rows NUMBER;
  tab_nums NUMBER;
  CURSOR cur_dba_hist IS
  SELECT table_name
  FROM dict
  WHERE table_name LIKE '%DBA_HIST_%'
  ORDER BY 1;
BEGIN
  DBMS_OUTPUT.PUT_LINE(CHR(13));
  DBMS_OUTPUT.PUT_LINE('All of the "DBA_HIST_" tables that returned 0 line are as follows:');
  DBMS_OUTPUT.PUT_LINE(CHR(13));
  
  tab_nums := 0;
  
  FOR v_dba_hist IN cur_dba_hist
  LOOP
    v_sql := 'SELECT COUNT(*) FROM ' || v_dba_hist.table_name;
    EXECUTE IMMEDIATE v_sql INTO tab_rows;
    IF tab_rows = 0 THEN
      tab_nums := tab_nums + 1;
      DBMS_OUTPUT.PUT_LINE(v_dba_hist.table_name);
    END IF;
  END LOOP;
  
  DBMS_OUTPUT.PUT_LINE(CHR(13));
  DBMS_OUTPUT.PUT_LINE('Total number of "DBA_HIST_" tables that returned 0 line is: ' || tab_nums || '.');
  DBMS_OUTPUT.PUT_LINE(CHR(13));
END;
/

All of the "DBA_HIST_" tables that returned 0 line are as follows:

DBA_HIST_BASELINE_TEMPLATE
DBA_HIST_CLUSTER_INTERCON
DBA_HIST_COLORED_SQL
DBA_HIST_CR_BLOCK_SERVER
DBA_HIST_CURRENT_BLOCK_SERVER
DBA_HIST_DLM_MISC
DBA_HIST_DYN_REMASTER_STATS
DBA_HIST_FILEMETRIC_HISTORY
DBA_HIST_IC_CLIENT_STATS
DBA_HIST_IC_DEVICE_STATS
DBA_HIST_INST_CACHE_TRANSFER
DBA_HIST_INTERCONNECT_PINGS
DBA_HIST_LATCH_CHILDREN
DBA_HIST_LATCH_PARENT
DBA_HIST_MEMORY_RESIZE_OPS
DBA_HIST_MEMORY_TARGET_ADVICE
DBA_HIST_MTTR_TARGET_ADVICE
DBA_HIST_PERSISTENT_QUEUES
DBA_HIST_PERSISTENT_SUBS
DBA_HIST_SESSMETRIC_HISTORY
DBA_HIST_SNAP_ERROR
DBA_HIST_STREAMS_APPLY_SUM
DBA_HIST_STREAMS_CAPTURE
DBA_HIST_WAITCLASSMET_HISTORY

Total number of "DBA_HIST_" tables that returned 0 line is: 24.

Incredible! Apart from the tidy DBA_HIST_ table names we also added the friendly prompt message before showing table names as well as outputting total numbers of all of empty DBA_HIST_ table.

[Back to Discovering ...]

[Back to TOC]

Using REF cursor and dynamic SQL to discover

It's similar to use explicit cursor and dynamic SQL to discover empty DBA_HIST_ tables we'll use REF cursor in this section. Here's my another anonymous pl/sql code blocks and executing result as follows:

SET SERVEROUTPUT ON;

DECLARE
  v_sql        VARCHAR2(200);
  v_tablename  VARCHAR2(50);
  tab_num      NUMBER;
  v_ref_cursor SYS_REFCURSOR;
BEGIN
  OPEN v_ref_cursor FOR
  SELECT table_name
  FROM dict
  WHERE table_name LIKE '%DBA_HIST_%'
  ORDER BY 1;

  LOOP
    FETCH v_ref_cursor INTO v_tablename;
    v_sql := 'SELECT COUNT(*) FROM ' || v_tablename;
    EXECUTE IMMEDIATE v_sql INTO tab_num;
    IF tab_num = 0 THEN
      DBMS_OUTPUT.PUT_LINE('The lines of ' || v_tablename || ' has been returned 0.');
    END IF;
    EXIT WHEN v_ref_cursor%NOTFOUND;
  END LOOP;
  
  CLOSE v_ref_cursor;
END;
/
The lines of DBA_HIST_BASELINE_TEMPLATE has been returned 0.
The lines of DBA_HIST_CLUSTER_INTERCON has been returned 0.
The lines of DBA_HIST_COLORED_SQL has been returned 0.
The lines of DBA_HIST_CR_BLOCK_SERVER has been returned 0.
The lines of DBA_HIST_CURRENT_BLOCK_SERVER has been returned 0.
The lines of DBA_HIST_DLM_MISC has been returned 0.
The lines of DBA_HIST_DYN_REMASTER_STATS has been returned 0.
The lines of DBA_HIST_FILEMETRIC_HISTORY has been returned 0.
The lines of DBA_HIST_IC_CLIENT_STATS has been returned 0.
The lines of DBA_HIST_IC_DEVICE_STATS has been returned 0.
The lines of DBA_HIST_INST_CACHE_TRANSFER has been returned 0.
The lines of DBA_HIST_INTERCONNECT_PINGS has been returned 0.
The lines of DBA_HIST_LATCH_CHILDREN has been returned 0.
The lines of DBA_HIST_LATCH_PARENT has been returned 0.
The lines of DBA_HIST_MEMORY_RESIZE_OPS has been returned 0.
The lines of DBA_HIST_MEMORY_TARGET_ADVICE has been returned 0.
The lines of DBA_HIST_MTTR_TARGET_ADVICE has been returned 0.
The lines of DBA_HIST_PERSISTENT_QUEUES has been returned 0.
The lines of DBA_HIST_PERSISTENT_SUBS has been returned 0.
The lines of DBA_HIST_SESSMETRIC_HISTORY has been returned 0.
The lines of DBA_HIST_SNAP_ERROR has been returned 0.
The lines of DBA_HIST_STREAMS_APPLY_SUM has been returned 0.
The lines of DBA_HIST_STREAMS_CAPTURE has been returned 0.
The lines of DBA_HIST_WAITCLASSMET_HISTORY has been returned 0.

PL/SQL procedure successfully completed.

Next we'll adjust it based on the same idea in the previous section.

SET SERVEROUTPUT ON;
SET FEEDBACK OFF;

DECLARE
  v_sql        VARCHAR2(200);
  v_tablename  VARCHAR2(50);
  tab_rows     NUMBER;
  tab_nums     NUMBER;
  v_ref_cursor SYS_REFCURSOR;
BEGIN
  OPEN v_ref_cursor FOR
  SELECT table_name
  FROM dict
  WHERE table_name LIKE '%DBA_HIST_%'
  ORDER BY 1;
  
  DBMS_OUTPUT.PUT_LINE(CHR(13));
  DBMS_OUTPUT.PUT_LINE('All of the "DBA_HIST_" tables that returned 0 line are as follows:');
  DBMS_OUTPUT.PUT_LINE(CHR(13));
  
  tab_nums := 0;
  
  LOOP
    FETCH v_ref_cursor INTO v_tablename;
    v_sql := 'SELECT COUNT(*) FROM ' || v_tablename;
    EXECUTE IMMEDIATE v_sql INTO tab_rows;
    IF tab_rows = 0 THEN
      tab_nums := tab_nums + 1;
      DBMS_OUTPUT.PUT_LINE(v_tablename);
    END IF;
    EXIT WHEN v_ref_cursor%NOTFOUND;
  END LOOP;
  
  CLOSE v_ref_cursor;
  
  DBMS_OUTPUT.PUT_LINE(CHR(13));
  DBMS_OUTPUT.PUT_LINE('Total number of "DBA_HIST_" tables that returned 0 line is: ' || tab_nums || '.');
  DBMS_OUTPUT.PUT_LINE(CHR(13));
END;
/

All of the "DBA_HIST_" tables that returned 0 line are as follows:

DBA_HIST_BASELINE_TEMPLATE
DBA_HIST_CLUSTER_INTERCON
DBA_HIST_COLORED_SQL
DBA_HIST_CR_BLOCK_SERVER
DBA_HIST_CURRENT_BLOCK_SERVER
DBA_HIST_DLM_MISC
DBA_HIST_DYN_REMASTER_STATS
DBA_HIST_FILEMETRIC_HISTORY
DBA_HIST_IC_CLIENT_STATS
DBA_HIST_IC_DEVICE_STATS
DBA_HIST_INST_CACHE_TRANSFER
DBA_HIST_INTERCONNECT_PINGS
DBA_HIST_LATCH_CHILDREN
DBA_HIST_LATCH_PARENT
DBA_HIST_MEMORY_RESIZE_OPS
DBA_HIST_MEMORY_TARGET_ADVICE
DBA_HIST_MTTR_TARGET_ADVICE
DBA_HIST_PERSISTENT_QUEUES
DBA_HIST_PERSISTENT_SUBS
DBA_HIST_SESSMETRIC_HISTORY
DBA_HIST_SNAP_ERROR
DBA_HIST_STREAMS_APPLY_SUM
DBA_HIST_STREAMS_CAPTURE
DBA_HIST_WAITCLASSMET_HISTORY

Total number of "DBA_HIST_" tables that returned 0 line is: 24

[Back to Discovering ...]

[Back to TOC]

Collecting empty DBA_HIST_ table numbers

Sorry, I've forgotten mentioning oracle 11.2.0.4 where I ran pl/sql code in the preceding topic. Now let's separately notice how many empty DBA_HIST_ tables in oracle 11.2.0.4, 19.3.0.0, 19.12.0.0 and 21.3.0.0. The following is output result when executing pl/sql code snippet via the prior topic.

-- Running on 11.2.0.4, shown 24 number of "DBA_HIST_" tables.

All of the "DBA_HIST_" tables that returned 0 line are as follows:

DBA_HIST_BASELINE_TEMPLATE
DBA_HIST_CLUSTER_INTERCON
DBA_HIST_COLORED_SQL
DBA_HIST_CR_BLOCK_SERVER
DBA_HIST_CURRENT_BLOCK_SERVER
DBA_HIST_DLM_MISC
DBA_HIST_DYN_REMASTER_STATS
DBA_HIST_FILEMETRIC_HISTORY
DBA_HIST_IC_CLIENT_STATS
DBA_HIST_IC_DEVICE_STATS
DBA_HIST_INST_CACHE_TRANSFER
DBA_HIST_INTERCONNECT_PINGS
DBA_HIST_LATCH_CHILDREN
DBA_HIST_LATCH_PARENT
DBA_HIST_MEMORY_RESIZE_OPS
DBA_HIST_MEMORY_TARGET_ADVICE
DBA_HIST_MTTR_TARGET_ADVICE
DBA_HIST_PERSISTENT_QUEUES
DBA_HIST_PERSISTENT_SUBS
DBA_HIST_SESSMETRIC_HISTORY
DBA_HIST_SNAP_ERROR
DBA_HIST_STREAMS_APPLY_SUM
DBA_HIST_STREAMS_CAPTURE
DBA_HIST_WAITCLASSMET_HISTORY

Total number of "DBA_HIST_" tables that returned 0 line is: 24
-- Running on 19.3, shown 53 number of "DBA_HIST_" tables.

All of the "DBA_HIST_" tables that returned 0 line are as follows:

DBA_HIST_APPLY_SUMMARY
DBA_HIST_ASM_BAD_DISK
DBA_HIST_ASM_DISKGROUP
DBA_HIST_ASM_DISKGROUP_STAT
DBA_HIST_ASM_DISK_STAT_SUMMARY
DBA_HIST_BASELINE_TEMPLATE
DBA_HIST_BUFFERED_QUEUES
DBA_HIST_BUFFERED_SUBSCRIBERS
DBA_HIST_CAPTURE
DBA_HIST_CELL_CONFIG
DBA_HIST_CELL_CONFIG_DETAIL
DBA_HIST_CELL_DB
DBA_HIST_CELL_DISKTYPE
DBA_HIST_CELL_DISK_NAME
DBA_HIST_CELL_DISK_SUMMARY
DBA_HIST_CELL_GLOBAL
DBA_HIST_CELL_GLOBAL_SUMMARY
DBA_HIST_CELL_IOREASON
DBA_HIST_CELL_NAME
DBA_HIST_CELL_OPEN_ALERTS
DBA_HIST_CLUSTER_INTERCON
DBA_HIST_COLORED_SQL
DBA_HIST_COMP_IOSTAT
DBA_HIST_CON_SYSMETRIC_HIST
DBA_HIST_CR_BLOCK_SERVER
DBA_HIST_CURRENT_BLOCK_SERVER
DBA_HIST_DLM_MISC
DBA_HIST_DYN_REMASTER_STATS
DBA_HIST_FILEMETRIC_HISTORY
DBA_HIST_FILESTATXS
DBA_HIST_IC_CLIENT_STATS
DBA_HIST_IC_DEVICE_STATS
DBA_HIST_IM_SEG_STAT
DBA_HIST_INST_CACHE_TRANSFER
DBA_HIST_INTERCONNECT_PINGS
DBA_HIST_JAVA_POOL_ADVICE
DBA_HIST_LATCH_CHILDREN
DBA_HIST_LATCH_PARENT
DBA_HIST_LMS_STATS
DBA_HIST_MEMORY_RESIZE_OPS
DBA_HIST_MEMORY_TARGET_ADVICE
DBA_HIST_MTTR_TARGET_ADVICE
DBA_HIST_RECOVERY_PROGRESS
DBA_HIST_REPLICATION_TBL_STATS
DBA_HIST_REPLICATION_TXN_STATS
DBA_HIST_SESSMETRIC_HISTORY
DBA_HIST_SESS_SGA_STATS
DBA_HIST_SNAP_ERROR
DBA_HIST_STREAMS_APPLY_SUM
DBA_HIST_STREAMS_CAPTURE
DBA_HIST_TEMPFILE
DBA_HIST_TEMPSTATXS
DBA_HIST_WAITCLASSMET_HISTORY

Total number of "DBA_HIST_" tables that returned 0 line is: 53.
-- Running on 19.12, shown 58 number of "DBA_HIST_" tables.

All of the "DBA_HIST_" tables that returned 0 line are as follows:

DBA_HIST_APPLY_SUMMARY
DBA_HIST_ASM_BAD_DISK
DBA_HIST_ASM_DISKGROUP
DBA_HIST_ASM_DISKGROUP_STAT
DBA_HIST_ASM_DISK_STAT_SUMMARY
DBA_HIST_BASELINE_TEMPLATE
DBA_HIST_BUFFERED_QUEUES
DBA_HIST_BUFFERED_SUBSCRIBERS
DBA_HIST_CAPTURE
DBA_HIST_CELL_CONFIG
DBA_HIST_CELL_CONFIG_DETAIL
DBA_HIST_CELL_DB
DBA_HIST_CELL_DISKTYPE
DBA_HIST_CELL_DISK_NAME
DBA_HIST_CELL_DISK_SUMMARY
DBA_HIST_CELL_GLOBAL
DBA_HIST_CELL_GLOBAL_SUMMARY
DBA_HIST_CELL_IOREASON
DBA_HIST_CELL_NAME
DBA_HIST_CELL_OPEN_ALERTS
DBA_HIST_CLUSTER_INTERCON
DBA_HIST_COLORED_SQL
DBA_HIST_COMP_IOSTAT
DBA_HIST_CON_SYSMETRIC_HIST
DBA_HIST_CR_BLOCK_SERVER
DBA_HIST_CURRENT_BLOCK_SERVER
DBA_HIST_DLM_MISC
DBA_HIST_DYN_REMASTER_STATS
DBA_HIST_FILEMETRIC_HISTORY
DBA_HIST_FILESTATXS
DBA_HIST_IC_CLIENT_STATS
DBA_HIST_IC_DEVICE_STATS
DBA_HIST_IM_SEG_STAT
DBA_HIST_INST_CACHE_TRANSFER
DBA_HIST_INTERCONNECT_PINGS
DBA_HIST_LATCH_CHILDREN
DBA_HIST_LATCH_PARENT
DBA_HIST_LMS_STATS
DBA_HIST_MEMORY_RESIZE_OPS
DBA_HIST_MEMORY_TARGET_ADVICE
DBA_HIST_MTTR_TARGET_ADVICE
DBA_HIST_PERSISTENT_QMN_CACHE
DBA_HIST_PERSISTENT_QUEUES
DBA_HIST_PERSISTENT_SUBS
DBA_HIST_RECOVERY_PROGRESS
DBA_HIST_REPLICATION_TBL_STATS
DBA_HIST_REPLICATION_TXN_STATS
DBA_HIST_RULE_SET
DBA_HIST_SESSMETRIC_HISTORY
DBA_HIST_SESS_SGA_STATS
DBA_HIST_SESS_TIME_STATS
DBA_HIST_SNAP_ERROR
DBA_HIST_STREAMS_APPLY_SUM
DBA_HIST_STREAMS_CAPTURE
DBA_HIST_STREAMS_POOL_ADVICE
DBA_HIST_TEMPFILE
DBA_HIST_TEMPSTATXS
DBA_HIST_WAITCLASSMET_HISTORY

Total number of "DBA_HIST_" tables that returned 0 line is: 58.
-- Running on 21.3, shown 60 number of "DBA_HIST_" tables.

All of the "DBA_HIST_" tables that returned 0 line are as follows:

DBA_HIST_APPLY_SUMMARY
DBA_HIST_ASM_BAD_DISK
DBA_HIST_ASM_DISKGROUP
DBA_HIST_ASM_DISKGROUP_STAT
DBA_HIST_ASM_DISK_STAT_SUMMARY
DBA_HIST_BASELINE_TEMPLATE
DBA_HIST_BUFFERED_QUEUES
DBA_HIST_BUFFERED_SUBSCRIBERS
DBA_HIST_CAPTURE
DBA_HIST_CELL_CONFIG
DBA_HIST_CELL_CONFIG_DETAIL
DBA_HIST_CELL_DB
DBA_HIST_CELL_DISKTYPE
DBA_HIST_CELL_DISK_NAME
DBA_HIST_CELL_DISK_SUMMARY
DBA_HIST_CELL_GLOBAL
DBA_HIST_CELL_GLOBAL_SUMMARY
DBA_HIST_CELL_IOREASON
DBA_HIST_CELL_NAME
DBA_HIST_CELL_OPEN_ALERTS
DBA_HIST_CLUSTER_INTERCON
DBA_HIST_COLORED_SQL
DBA_HIST_COMP_IOSTAT
DBA_HIST_CON_SYSMETRIC_HIST
DBA_HIST_CR_BLOCK_SERVER
DBA_HIST_CURRENT_BLOCK_SERVER
DBA_HIST_DLM_MISC
DBA_HIST_DYN_REMASTER_STATS
DBA_HIST_FILEMETRIC_HISTORY
DBA_HIST_FILESTATXS
DBA_HIST_IC_CLIENT_STATS
DBA_HIST_IC_DEVICE_STATS
DBA_HIST_IM_SEG_STAT
DBA_HIST_INST_CACHE_TRANSFER
DBA_HIST_INTERCONNECT_PINGS
DBA_HIST_JAVA_POOL_ADVICE
DBA_HIST_LATCH_CHILDREN
DBA_HIST_LATCH_PARENT
DBA_HIST_LMS_STATS
DBA_HIST_MEMORY_RESIZE_OPS
DBA_HIST_MEMORY_TARGET_ADVICE
DBA_HIST_MTTR_TARGET_ADVICE
DBA_HIST_PERSISTENT_QMN_CACHE
DBA_HIST_PERSISTENT_QUEUES
DBA_HIST_PERSISTENT_SUBS
DBA_HIST_RECOVERY_PROGRESS
DBA_HIST_REPLICATION_TBL_STATS
DBA_HIST_REPLICATION_TXN_STATS
DBA_HIST_RULE_SET
DBA_HIST_SESSMETRIC_HISTORY
DBA_HIST_SESS_NETWORK
DBA_HIST_SESS_SGA_STATS
DBA_HIST_SESS_TIME_STATS
DBA_HIST_SNAP_ERROR
DBA_HIST_STREAMS_APPLY_SUM
DBA_HIST_STREAMS_CAPTURE
DBA_HIST_STREAMS_POOL_ADVICE
DBA_HIST_TEMPFILE
DBA_HIST_TEMPSTATXS
DBA_HIST_WAITCLASSMET_HISTORY

Total number of "DBA_HIST_" tables that returned 0 line is: 60.

[Back to TOC]

Visualizing empty DBA_HIST_ table numbers

Now we're able to get a statistic table collecting empty DBA_HIST_ table numbers in different oracle versions, such as:

Oracle_Versions Empty_Dba_Hist_Table_Nums
--------------- -------------------------
11.2.0.4                               24
19.3.0.0                               53
19.12.0.0                              58
21.3.0.0                               60

Next we use Microsoft Office Excel to visualize it. Here's a relevant screenshot.


That's all of stuff in this blog note about discovering empty DBA_HIST_ tables in different oracle versions. If you have any good advice or suggestion please leave your message in the bottom of comment area. Meanwhile I'll read every message and reply to you ASAP. Really hope to give me some feedback, thanks for reading spending your expensive time!

[Back to TOC]

Reference stuff

[Back to TOC]

Updated on Dec 11, 2021 at night:

  • Adding an entry about the sql source code (mentioned previously in this blog note) that has been published on my GitHub in the Reference stuff;

最后修改时间:2021-12-11 20:35:00
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论