This document discusses the DBA_FEATURE_USAGE_STATISTICS view in Oracle databases, which tracks database feature usage. It describes what is stored in the view, the underlying tables and packages that populate it, and how to manually refresh the data. It also covers how to determine if a feature is installed and how its usage is detected, using the installation check and usage detection logic stored in the WRI$_DBU_FEATURE_METADATA table. The document demonstrates some examples and concludes with information on reports produced by Oracle on database options and management pack usage based on the DBA_FEATURE_USAGE_STATISTICS data.
3. Disclaimer
● this presentation is ONLY about the features and
possibilities of DBA_FEATURE_USAGE_STATISTICS view
and supporting packages/procedures
● NO information about LMS activities
● NO information about license optimization
3
8. DBID NUMBER No database ID of database being tracked
NAME VARCHAR2(128 B) No name of feature
VERSION VARCHAR2(17 B) No the database version the feature was tracked in
DETECTED_USAGES NUMBER No number of times the system has detected usage for the feature
TOTAL_SAMPLES NUMBER No number of times the system has woken up and checked for usage
CURRENTLY_USED VARCHAR2(5 B) Yes if usage was detected the last time the system checked
FIRST_USAGE_DATE DATE Yes the first sample time the system detected usage for the feature
LAST_USAGE_DATE DATE Yes the last sample time the system detected usage for the feature
AUX_COUNT NUMBER Yes extra column to store feature specific usage data
FEATURE_INFO CLOB Yes extra column to store feature specific usage data
LAST_SAMPLE_DATE DATE Yes last time the system checked for usage
LAST_SAMPLE_PERIOD NUMBER Yes amount of time between the last two usage sample times, in seconds
SAMPLE_INTERVAL NUMBER Yes [ 604800 seconds => 7 days ]
DESCRIPTION VARCHAR2(128 B) Yes describes feature and usage detection logic
DBA_FEATURE_USAGE_STATISTICS
8
9. SELECT samp.dbid, fu.name, samp.version, detected_usages , total_samples ,
Decode(To_char(last_usage_date , 'MM/DD/YYYY, HH:MI:SS' ), NULL, 'FALSE',
To_char(last_sample_date , 'MM/DD/YYYY, HH:MI:SS' ), 'TRUE', 'FALSE')
currently_used ,
first_usage_date , last_usage_date , aux_count, feature_info ,
last_sample_date ,
last_sample_period , sample_interval , mt.description
FROM wri$_dbu_usage_sample samp,
wri$_dbu_feature_usage fu,
wri$_dbu_feature_metadata mt
WHERE samp.dbid = fu.dbid
AND samp.version = fu.version
AND fu.name = mt.name
AND fu.name NOT LIKE '_DBFUS_TEST%'
AND /* filter out test features */
Bitand(mt.usg_det_method , 4) != 4 /* filter out disabled features */;
DBA_FEATURE_USAGE_STATISTICS
9
18. alter session set events
'immediate trace name mmon_test level 6';
Information About DBA_FEATURE_USAGE_STATISTICS Table (Doc ID 2535290.1)
18
alter session set "_SWRF_TEST_ACTION"=53;
How to Manually Refresh Dba_feature_usage_statistics (Doc ID 1629485.1)
dbms_feature_usage_internal.exec_db_usage_sampling(sysdate);
Tracking Database Feature Usage (DBA_FEATURE_USAGE_STATISTICS) - oraclebase.com
19. 19
other "_SWRF_TEST_ACTION" values
ADR auto purge
alter session set "_swrf_test_action" = 101;
Bug 9530322 ADR auto purge does not occur in ASM instance or standby database
Split the AWR partitions
alter session set "_swrf_test_action" = 72;
Manually Purge the Optimizer Statistics & AWR Snaphots to Reduce Space Usage of SYSAUX Tablespace (Doc
ID 1965061.1)
AWR Snapshot traces
snapshot flush trace enable 10 disable 11
MMON action trace enable 28 disable 29
Troubleshooting: AWR Snapshot Collection Issues (Doc ID 1301503.1)
?
20. alter session set events
'immediate trace name mmon_test level 6';
Information About DBA_FEATURE_USAGE_STATISTICS Table (Doc ID 2535290.1)
20
alter session set "_SWRF_TEST_ACTION"=53;
How to Manually Refresh Dba_feature_usage_statistics (Doc ID 1629485.1)
dbms_feature_usage_internal.exec_db_usage_sampling(sysdate);
Tracking Database Feature Usage (DBA_FEATURE_USAGE_STATISTICS) - oraclebase.com
DEMO
22. Is the feature installed?
22
wri$_dbu_feature_metadata
*NAME VARCHAR2(128 B)
INST_CHK_METHOD NUMBER(38,0)
INST_CHK_LOGIC CLOB
USG_DET_METHOD NUMBER(38,0)
USG_DET_LOGIC CLOB
DESCRIPTION VARCHAR2(128 B)
DBU_INST_ALWAYS_INSTALLED 1 /* no test required */
DBU_INST_OBJECT 2 /* object name in LOGIC */
DBU_INST_TEST 4 /* only test */
5 internal - no test required
6 internal - object name in LOGIC
NAME INST_CHK_LOGIC
...
In-Memory ADO Policies SYS.ILM$
Information Lifecycle Management SYS.ilm$
Semantics/RDF MDSYS.RDF_Models
...
23. How to test the feature
23
wri$_dbu_feature_metadata
*NAME VARCHAR2(128 B)
INST_CHK_METHOD NUMBER(38,0)
INST_CHK_LOGIC CLOB
USG_DET_METHOD NUMBER(38,0)
USG_DET_LOGIC CLOB
DESCRIPTION VARCHAR2(128 B)
DBU_DETECT_BY_SQL 1 /* SQL specified in USG_DET_LOGIC */
DBU_DETECT_BY_PROCEDURE 2 /* Procedure -- “ -- */
DBU_DETECT_NULL 4 /* only test for _DBFUS_TEST_SQL_7 */
NAME USG_DET_LOGIC
...
In-Memory ADO Policies DBMS_FEATURE_IM_ADO
Information Lifecycle Management DBMS_FEATURE_ILM
Semantics/RDF select count(*), count(*), null from ( (
select 1
from sys.all_views
where view_name='RDF_MODEL$' and owner='MDSYS')
UNION ALL (
select 1
from sys.all_views rm, sys.all_tables rl, sys.all_tables rv
where rm.view_name like '%#RDF_MODEL$'
...
26. How to test the feature
26
wri$_dbu_feature_metadata
*NAME VARCHAR2(128 B)
INST_CHK_METHOD NUMBER(38,0)
INST_CHK_LOGIC CLOB
USG_DET_METHOD NUMBER(38,0)
USG_DET_LOGIC CLOB
DESCRIPTION VARCHAR2(128 B)
DBU_DETECT_BY_SQL 1 /* SQL specified in USG_DET_LOGIC */
DBU_DETECT_BY_PROCEDURE 2 /* Procedure -- “ -- */
DBU_DETECT_NULL 4 /* only test for _DBFUS_TEST_SQL_7 */
NAME USG_DET_LOGIC
...
In-Memory ADO Policies DBMS_FEATURE_IM_ADO
Information Lifecycle Management DBMS_FEATURE_ILM
Semantics/RDF select count(*), count(*), null from ( (
select 1
from sys.all_views
where view_name='RDF_MODEL$' and owner='MDSYS')
UNION ALL (
select 1
from sys.all_views rm, sys.all_tables rl, sys.all_tables rv
where rm.view_name like '%#RDF_MODEL$'
...
DEMO...
29. Database Options/Management Packs Usage Reporting for Oracle Databases 11gR2, 12c, 12cR2 and 18c
(Doc ID 1317265.1) - Jul 16, 2019
Kindly note the report generated is to be used for informational purposes only and this does not represent your
license entitlement or requirement. for known issues with this check MOS DOC ID 1309070.1
PRODUCT USAGE
This section provides an overview of each option/pack that has been used in the database and if they are
currently in use. It will also provide information when the product was first used and when it was used last time.
FEATURE USAGE DETAILS
This section provides a detailed report of features used that has triggered the usage of a product.
The report is based on the DBA_FEATURE_USAGE_STATISTICS view.
The CURRENTLY_USED column of DBA_FEATURE_USAGE_STATISTICS view indicates if the feature in question
was used during the last sampling interval by VERSION and DBID
MOS
29
30. Place Holder For Feature Usage Tracking Bugs (Doc ID 1309070.1) - Aug 4, 2018
1. Bug 11902001 - Exclude default users for Feature usage tracking for Securefiles option
…
5. RMAN default Backup BZIP2 Compression feature is reported wrongly as as an Advanced Compression feature
…
9. Bug 16563444 - HEAT MAP FEATURE USAGE TRACKING IS NOT CORRECT
…
14. Bug 23734270 - DBA_FEATURE_USAGE_STATISTICS SHOWS PERMANENT USAGE OF REAL-TIME SQL
MONITORING
MOS
30
31. Database Options/Management Packs Usage Reporting for Oracle Databases 11gR2, 12c, 12cR2 and 18c
(Doc ID 1317265.1) - Jul 16, 2019
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
------- Name : options_packs_usage_statistics.sql
------- MOS DOC ID 1317265.1
-------
------- Applies to: Oracle Database - Version 11.2 and later
…
------- Modified Mon-YYYY
------- sserban Apr-2018 - Updated to handle version 18.1 and align to the new versioning model
(Doc ID 2285040.1)
…
-- mapping between features tracked by DBA_FUS and their corresponding database products (options or packs)
MOS
31
32. DECLARE
l_dbid NUMBER;
i NUMBER;
l_version VARCHAR2(200);
output_tab dbms_swrf_report_internal .output_table ;
BEGIN
l_dbid := 989228896; l_version := '19.0.0.0.0' ;
output_tab := dbms_swrf_report_internal .Dbfus_report_main(l_dbid => l_dbid,
l_version => l_version, l_options => 0, to_html => TRUE);
i := output_tab.first;
WHILE i IS NOT NULL LOOP
dbms_output .Put_line(Output_tab(i));
i := output_tab.NEXT(i);
END LOOP;
END;
/
DBMS_SWRF_REPORT_INTERNAL
.DBFUS_REPORT_MAIN
32
???
34. SELECT dbid, hwm.name, version,
highwater, last_value, description
FROM wri$_dbu_high_water_mark hwm,
wri$_dbu_hwm_metadata mt
WHERE hwm.name = mt.name
AND hwm.name NOT LIKE '_HWM_TEST%'
AND /* filter out test hwm */
Bitand(mt.method, 4) != 4 /* filter out disabled hwm */;
DBA_HIGH_WATER_MARK_STATISTICS
34
35. Disclaimer
● this presentation is ONLY about the features and
possibilities of DBA_FEATURE_USAGE_STATISTICS view
and supporting packages/procedures
● NO information about LMS activities
● NO information about license optimization
35