by Doug Doering
ITM Oracle Extended Agent (RZ) requires Enterprise Edition Oracle WITH "Diagnostic Pack License" and "STATISTIC_LEVEL=TYPICAL/ALL" to support gathering of Top SQL data with "KRZRDB TOP SQL" attribute group.
The ONLY environment that supports data being written to the "dba_hist_sqlstat" table is to be running Enterprise Edition of Oracle WITH "Diagnostic Pack License".
With an Enterprise Edition of Oracle with "Diagnostic Pack License", in order for data to be in the "dba_hist_sqlstat" table would also require STATISTICS_LEVEL=TYPICAL or ALL.
The default is "TYPICAL".
To verify the value set for STATISTICS_LEVEL:
SQL> show parameter statistics_level
Setting STATISTICS_LEVEL=BASIC will prevent data being available in "dba_hist_snapshot" and "dba_hist_sqlstat" tables.
https://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams211.htm#REFRN10214.
STATISTICS_LEVEL specifies the level of collection for database and operating system statistics. The Oracle Database collects these statistics for a variety of purposes, including making self-management decisions.
The default setting of TYPICAL ensures collection of all major statistics required for database self-management functionality and provides best overall performance. The default value should be adequate for most environments.
When the STATISTICS_LEVEL parameter is set to ALL, additional statistics are added to the set of statistics collected with the TYPICAL setting. The additional statistics are timed OS statistics and plan execution statistics.
Setting the STATISTICS_LEVEL parameter to BASIC disables the collection of many of the important statistics required by Oracle Database features and functionality, including:
- Automatic Workload Repository (AWR) Snapshots
- Automatic Database Diagnostic Monitor (ADDM)
- All server-generated alerts
- Automatic SGA Memory Management
- Automatic optimizer statistics collection
- Object level statistics
- End to End Application Tracing (V$CLIENT_STATS)
- Database time distribution statistics (V$SESS_TIME_MODEL and V$SYS_TIME_MODEL)
- Service level statistics
- Buffer cache advisory
- MTTR advisory
- Shared pool sizing advisory
- Segment level statistics
- PGA Target advisory
- Timed statistics
- Monitoring of statistics
The Oracle requirements are needed to populate Oracle DB tables - dba_hist_snapshot and dba_hist_sqlstat.
RZ monitoring agent relies on 2 SQL queries against the contents of these Oracle DB tables:
Example SQL queries that RZ agent issues:
The first SQL query is issued against the dba_hist_snapshot table to determine the snapshot ID from the latest snapshot available.
Example:
SQL> select snap.instance_number, max(snap.snap_id) endsnap, min(snap.snap_id) beginsnap, max(snap.startup_time) startuptime, min(snap.begin_interval_time) begininterval, max(snap.end_interval_time) endinterval from dba_hist_snapshot snap, (select instance_number, max(startup_time) startup_time from dba_hist_snapshot where startup_time < sysdate- '2'/24 group by instance_number) snapstart where snap.instance_number = snapstart.instance_number and snap.startup_time = snapstart.startup_time and snap.begin_interval_time > sysdate- '2'/24 and snap.end_interval_time < sysdate- '0'/24 group by snap.instance_number
The second SQL query uses the snapshot ID obtained from the first SQL query and the four filter criteria specified on the situation / historical collection definition to query details from the dba_hist_sqlstat table.
Example:
select * from dba_hist_sqlstat WHERE SNAP_ID= ${snapshotid from dba_hist_snapshot} and ROWNUN <=5;
In addition to Oracle requirements for underlying database tables that SQL queries are issued against, the RZ agent also requires defining Situations / Historical collections against the "KRZRDB TOP SQL" attribute group under the "Oracle RDBMS" application to define the two SQL queries to be issued against these Oracle tables.
Tivoli Composite Application Manager for Applications > Tivoli Composite Application Manager for Applications 7.2.1.1 > Oracle Database Extended agent 6.3.1 Fix Pack 2 > Installation and configuration > Agent installation and configuration > Agent-specific installation and configuration > Configuring Top SQL monitoring
https://www.ibm.com/support/knowledgecenter/en/SS3JRN_7.2.1/com.ibm.itcama.doc_7.2.1/oracleextended/fac_config_agentspecific_configtopsql.html?cp=SS3JRN_7.2.1.1
The ITM Situation / Historical collections defined against "KRZRDB TOP SQL" - KRZ.KRZTOPSQL must specify valid values for the four filter criteria:
- "Begin Hour Before Current" - KRZ_RDB_TOP_SQL.BEG_HOUR
- "End Hour Before Current" - KRZ_RDB_TOP_SQL.END_HOUR
- "Order By" - KRZ_RDB_TOP_SQL.ORDERBY
- "Row Order" - KRZ_RDB_TOP_SQL.ROWORDER
DOC APAR IV94961 was taken against Tivoli Composite Application Manager for Applications manuals to externalize the requirements of the Oracle Database Extended monitoring agent for Top SQL attribute data.
From Oracle documentation, in order for AWR to write data to the "dba_hist_sqlstat" table, this requires Diagnostic Pack License.
The following document from oracle shows what AWR cannot be used without purchasing the License for the the Diagnostic pack
https://docs.oracle.com/cd/B28359_01/license.111/b28287/options.htm#DBLIC164
The above document states the following:
"All data dictionary views beginning with the prefix DBA_HIST_ are part of this pack, along with their underlying tables.The only exception are the views: DBA_HIST_SNAPSHOT, DBA_HIST_DATABASE_INSTANCE, DBA_HIST_SNAP_ERROR, DBA_HIST_SEG_STAT, DBA_HIST_SEG_STAT_OBJ, and DBA_HIST_UNDOSTAT. They can be used without the Diagnostic Pack license."
From Oracle documentation, "Diagnostic Pack License" is ONLY available on Enterprise Editions of Oracle.
Oracle 10.2 Feature Availability
https://docs.oracle.com/cd/B19306_01/license.102/b14199/editions.htm#BABJICBB
Oracle 11.1 Feature Availability
https://docs.oracle.com/cd/B28359_01/license.111/b28287/editions.htm#DBLIC109
Oracle 12.1 Feature Availability
https://docs.oracle.com/database/121/DBLIC/editions.htm#DBLIC109
If you search for Oracle Diagnostics Pack on each of the above documents, you will see that only the Enterprise version supports this feature.
Statspack is not a replacement for Diagnostic Pack License function in AWR.
Statspack may gather similar information to that gathered by Diagnostic Pack License in AWR, but Statspack does NOT write data to the "dba_hist_sqlstat" table. Statspack writes to completely different tables, so will not support ITM RZ agent function for Top SQL attribute collection.
L3 tested to confirm that Statspack can not be used as a replacement as far as ITM RZ agent is concerned.
Oracle Standard Edition (SE)
Oracle Enterprise Edition (EE)
SE without "Statspack" - no data in dba_hist_sqlstat
SE with "Statspack"- no data in dba_hist_sqlstat
EE with Diagnostic Pack License without "Statspack" - data in dba_hist_sqlstat
From Oracle documentation, "Topnsql" determines the number of rows of data for Top SQL written to AWR reports:
"Topnsql" value controls the number of rows to return.
***
Topnsql
This controls the number of Top SQLs to flush into the AWR for each of the "Top" criteria (Elapsed Time, CPU Time etc). This can be set to a numeric value, or DEFAULT, MAXIMUM. The minimum value is 30 and the maximum 50,000. DEFAULT will capture the top 30 (statistics_level=TYPICAL) or the top 100 (statistics_level=ALL). MAXIMUM will capture the complete set of SQL in the cursor cache.