HANA Workload 1.00.74+ ESS
HANA Workload 1.00.74+ ESS
HANA Workload 1.00.74+ ESS
/*
[NAME]
- HANA_Workload_1.00.74+_ESS
[DESCRIPTION]
[SOURCE]
[VALID FOR]
[INVOLVED TABLES]
- M_WORKLOAD
- HOST_WORKLOAD
[INPUT PARAMETERS]
- BEGIN_TIME
Begin time
'2018/12/05 14:05:00' --> Set begin time to 5th of December 2018, 14:05
'C' --> Set begin time to current time
'C-S900' --> Set begin time to current time minus 900 seconds
'C-M15' --> Set begin time to current time minus 15 minutes
'C-H5' --> Set begin time to current time minus 5 hours
'C-D1' --> Set begin time to current time minus 1 day
'C-W4' --> Set begin time to current time minus 4 weeks
'E-S900' --> Set begin time to end time minus 900 seconds
'E-M15' --> Set begin time to end time minus 15 minutes
'E-H5' --> Set begin time to end time minus 5 hours
'E-D1' --> Set begin time to end time minus 1 day
'E-W4' --> Set begin time to end time minus 4 weeks
'MIN' --> Set begin time to minimum (1000/01/01 00:00:00)
- END_TIME
End time
'2018/12/08 14:05:00' --> Set end time to 8th of December 2018, 14:05
'C' --> Set end time to current time
'C-S900' --> Set end time to current time minus 900 seconds
'C-M15' --> Set end time to current time minus 15 minutes
'C-H5' --> Set end time to current time minus 5 hours
'C-D1' --> Set end time to current time minus 1 day
'C-W4' --> Set end time to current time minus 4 weeks
'B+S900' --> Set end time to begin time plus 900 seconds
'B+M15' --> Set end time to begin time plus 15 minutes
'B+H5' --> Set end time to begin time plus 5 hours
'B+D1' --> Set end time to begin time plus 1 day
'B+W4' --> Set end time to begin time plus 4 weeks
'MAX' --> Set end time to maximum (9999/12/31 23:59:59)
- TIMEZONE
- HOST
Host name
- PORT
Port number
- DATA_SOURCE
- AGGREGATE_BY
- TIME_AGGREGATE_BY
[OUTPUT PARAMETERS]
[EXAMPLE OUTPUT]
-----------------------------------------------------------------------------------
-----------------------------
|SNAPSHOT_TIME |HOST |PORT |EXEC_PER_S|PREP_PER_S|TRANS_PER_S|
UPD_TRANS_PER_S|COMMIT_PER_S|ROLLBACK_PER_S|
-----------------------------------------------------------------------------------
-----------------------------
|2014/12/19 (FRI)|saphanadb| any| 15363.65| 103.94| 38.04|
37.73| 38.03| 0.01|
|2014/12/18 (THU)|saphanadb| any| 11145.88| 89.44| 26.25|
25.65| 26.22| 0.03|
|2014/12/17 (WED)|saphanadb| any| 14473.61| 122.74| 30.05|
26.85| 29.99| 0.06|
|2014/12/16 (TUE)|saphanadb| any| 12951.43| 94.15| 28.05|
26.88| 27.97| 0.08|
|2014/12/15 (MON)|saphanadb| any| 15908.58| 101.16| 25.51|
24.64| 25.46| 0.04|
|2014/12/14 (SUN)|saphanadb| any| 5007.65| 7.43| 17.08|
16.27| 17.06| 0.02|
|2014/12/13 (SAT)|saphanadb| any| 7502.89| 12.72| 18.58|
17.52| 18.55| 0.03|
-----------------------------------------------------------------------------------
-----------------------------
*/
SNAPSHOT_TIME,
HOST,
LPAD(PORT, 5) PORT,
LPAD(TO_DECIMAL(CURRENT_EXECUTION_RATE / 60, 10, 2), 10) EXEC_PER_S,
LPAD(TO_DECIMAL(CURRENT_COMPILATION_RATE / 60, 10, 2), 10) PREP_PER_S,
LPAD(TO_DECIMAL(CURRENT_TRANSACTION_RATE / 60, 10, 2), 11) TRANS_PER_S,
LPAD(TO_DECIMAL(CURRENT_UPDATE_TRANSACTION_RATE / 60, 10, 2), 15)
UPD_TRANS_PER_S,
LPAD(TO_DECIMAL(CURRENT_COMMIT_RATE / 60, 10, 2), 12) COMMIT_PER_S,
LPAD(TO_DECIMAL(CURRENT_ROLLBACK_RATE / 60, 10, 2), 14) ROLLBACK_PER_S
FROM
( SELECT
CASE WHEN AGGREGATE_BY = 'NONE' OR INSTR(AGGREGATE_BY, 'HOST') != 0 THEN HOST
ELSE MAP(BI_HOST, '%', 'any', BI_HOST) END HOST,
CASE WHEN AGGREGATE_BY = 'NONE' OR INSTR(AGGREGATE_BY, 'PORT') != 0 THEN
TO_VARCHAR(PORT) ELSE MAP(BI_PORT, '%', 'any', BI_PORT) END PORT,
SNAPSHOT_TIME,
SUM(CURRENT_EXECUTION_RATE) CURRENT_EXECUTION_RATE,
SUM(CURRENT_COMPILATION_RATE) CURRENT_COMPILATION_RATE,
SUM(CURRENT_TRANSACTION_RATE) CURRENT_TRANSACTION_RATE,
SUM(CURRENT_UPDATE_TRANSACTION_RATE) CURRENT_UPDATE_TRANSACTION_RATE,
SUM(CURRENT_COMMIT_RATE) CURRENT_COMMIT_RATE,
SUM(CURRENT_ROLLBACK_RATE) CURRENT_ROLLBACK_RATE
FROM
( SELECT
CASE
WHEN BI.AGGREGATE_BY = 'NONE' OR INSTR(BI.AGGREGATE_BY, 'TIME') != 0 THEN
CASE
WHEN BI.TIME_AGGREGATE_BY LIKE 'TS%' THEN
TO_VARCHAR(ADD_SECONDS(TO_TIMESTAMP('2014/01/01 00:00:00',
'YYYY/MM/DD HH24:MI:SS'), FLOOR(SECONDS_BETWEEN(TO_TIMESTAMP('2014/01/01 00:00:00',