Professional Documents
Culture Documents
01-Day3 - Norma Introduction and Troubleshooting New
01-Day3 - Norma Introduction and Troubleshooting New
Privileged and confidential. The information contained in this material is privileged and confidential, and is intended only for the use of the individual to whom it is addressed and others who have been specifically authorized to receive it.
If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this material is strictly prohibited. If you have received this material in error, please destroy it immediately.
Lesson Objective
2
Below topics we will cover during this presentation.
Norma rule.
Clients for managing Norma rule (KPI generator + PMM Admin)
Norma Chain Flow
Norma DB tables
Norma environment variable
Norma log reading
Late Counter Handling Mechanism
Norma Useful queries
3
Norma rule.
• KPI Generator (also known as Norma) is a PMM utility for calculating KPIs from
performance data.
• In general, the KPI Generator process reads data from raw data tables. It
calculates for each instance per measurement time, and loads the calculated
KPIs into the counter table of the base resolution (or any other resolution).
4
Clients for managing Norma rule
(KPI generator + PMM Admin)
• KPI Generator:- This tool can be accessed from Teoco Studio. This tool is
used to create Norma rule.
• Lets Open this tool from Portal and understand the flow of creating
Norma rule. (This will done in PP3)
• PMM Admin: This client can be accessed from Teoco portal under PMM
tab. This tool is used to mange aggregation , SPC and KPI (Norma rule.)
(This will done in PP3)
• Lets open this tool from portal and understand its options. (This will done in
PP3)
5
Norma Chain Flow
6
Norma Working Flow
The actions made by Norma process:
• Check that the data we have in the source table is newer (datestamp)
than last handled datestamp.
• Check that the data (datetime) is in the range of the gaps define for this
rule resolution.
• Create Keys table from the source table of the data that needs to be
insert to the target table, like: datetime, name of entity… ( this
mechanism is for late counters) by datestamp filter.
• Do join between the source table and the keys table and insert into the
target table. In case some of the data was already there (late
counters) , it puts the data into a temp table and then do delete in the
target table and later do the insert again, this is called update by delete.
7
Norma Working Flow
There are 3 time parameters that the Norma consider:
• datestamp – The Norma will run on data that the datestamp >
pmm_norma_inputs.last_handled_datestamp column of that rule.
• datetime – The Norma will run on data that its datetime is in the gap defined in the
kpi_generator_dt_limit.connect per its resolution – how much to look back in gaps:
• MaxQuery- The range that the Norma will run the query in each iteration. It is define in table:
pmmconf_db.pmm_parameter NORMA_COMP. The default value is 5 gaps. So for QH rule it will run a
query for 1 hr. and 15m = 5 gaps each query to db.
8
Norma Server Process
Norma product Processes :
• connect -daemon dvx2_norma_for_father.connect
9
Norma DB tables
• PMMCONF_DB schema: Related Norma rules:
10
Norma Useful queries
For checking maximum DATETIME arrived to target table:
select max(DATETIME)
from [TARGET_TABLE]
11
To see the LAST_HANDLED_DATESTAMP that were retrieved
from input tables
Select INPUT_TABLE , LAST_HANDLED_DATESTAMP
from PMMCONF_DB.PMM_NORMA_INPUTS
where NORMA_NAME=<norma name>
12
Norma environment variable
• data/ Contains the trs and trl file for each Norma rule.
• Troll:
• PMM2_IMP_DIR/data /<NORMA NAME>.trs
• $KPI_GENERATOR_GLOBAL_TPT
• $KPI_GENERATOR_LOCAL_TPT
• $PMM2_IMP_DIR/data /<NORMA NAME>.trl
13
Norma environment variable
$PMM2_PROJ_DIR/ This directory is used to over right any
configuration of product. In this directory we copy some product file
and make some changes as per the project.
For example: For changing DT limit and adding hint we edit below
two files under ‘scripts’ subdirectory
lets have a look on files.
/kpi_generator_dt_limit.connect
/kpi_generator_hint.connect
14
Norma log reading
Cycle beginning: search for "Constructor"
• When defining raw data tables that will be input to the KPI Generator
process, you must map a PMM_DATESTAMP column for each raw
data table. The PMM_DATESTAMP column stores the time that the
record was inserted in the table. The KPI Generator retains in its
internal table the last PMM_DATESTAMP handled for each raw data
table used for a specific KPI Generator rule. When the tool starts a
new cycle, it reads all the data that arrived after the last handled date
stamp. The PMM_DATESTAMP column on the raw data table is
mandatory. If its value is NULL, the record will not be retrieved by the
KPI Generator process.
16
Example:
KPI Generator runs every 5 minutes with an activation delay of 1 minute. It runs at 10:06:00. This
is the content of the table at run time:
Only data for SW1 was read and passed to the Transform.
At 10:10:29 the data with a PMM_DATETIME of 10:10:00 arrived for both SW1 and SW2.
In addition, the raw data for 10:05:00 for SW2 arrived late. This is how the table looks:
17
The PMM metadata tables retain the last handled PMM_DATESTAMP for this raw data table,
which is 10:05:23. In this cycle all the records that have a PMM_DATESTAMP larger than
10:00:05:23 will be retrieved. In the cycle that runs at 10:11:00, the following data will be passed
to the Transform:
18
• Late Counters Handling (cont.)
The KPI Generator supports 2 modes for handling the arriving counters:
Insert case
No database record has created before.
This case is relevant to regular counter arrivals and time zone handling.
Update case
It includes joined Norma cases with Mandatory and Optional counters.
The mandatory data arrived first and the optional counters later.
In order to handle the late counters there is a need to update the database
record output.
19
• Late Counters Example
On a cycle performed on 1/3/2019 the KPI Generator discovered that the missing
optional data arrived.
Note: When the Norma tries to insert to the target table it uses simple insert - so for
regular case that the data is new, it is loaded. But if it is late counters and the record is
already in the target table ( with less counters) then the first try will fail ( unique
constraint for duplicate) and then it will act as update by delete in order to delete exist
record and insert the new record.
20
Lesson Summary – Q&A
Where can you find the connect of Norma?
What is the log directory of Norma rules?
21