Most Teradata systems support different processing windows, each which has a somewhat different set of business priorities. From 8 AM to 12 noon the most important work may be the Dashboard application queries. But from 12 noon to 6 PM it could be the ad hoc business users. At night maybe it’s the batch loads and reporting. Planned Environments function within the TASM state matrix to support the ability to automatically manage changes to workload management setup during those different windows of time.
The state matrix represents more than just processing windows, however. It intersects your Planned Environments (time-based processing windows) with any system Health Conditions you may have defined (such as high AMP worker task usage levels, or hardware disabilities). TASM moves you from one Planned Environment to another or one Health Condition to another based on events that you have defined being triggered (such as time of day).
At the intersection of the two dimensions are the TASM states, which contain the actual workload management setup definitions. A state may contain different values for some of the TASM settings, such as throttle limits or workload priorities. So when you change state, you are changing some of the rules that TASM uses when it manages your workloads.
Example of a State Matrix
The figure below illustrates a simple 4 x 3 state matrix. The Planned Environments go along the top, and the Health Conditions go along the left side. The same state can be, and often is, used at multiple intersection points.
How TASM Decides Which State to Switch to
At each event interval, all system events are checked to see if a Health Condition needs to be changed. After that is done, all defined Planned Environments are checked to see if a different Planned Environment should now be in effect. It is possible for both the Planned Environment and the Health Condition to change on a given event interval. Once the correct ones are established, their intersection points to the state that they are associated with.
If more than one Planned Environment meets the current conditions (for example, one planned environment is for Monday and the other is for the end of the month and the end of the month falls on a Monday), then the Planned Environment with the highest precedence number wins. This will usually be the one in the rightmost position in the state matrix.
When the Planned Environments are evaluated to see which one should be active, internally the search is performed from the right-most state (the one with the highest precedence) and moves leftwards, stopping at the first Planned Environment that fits the criteria. For Health Conditions, the search starts at the bottom, with the one with the highest severity, stopping at the first Health Condition that qualifies. That way, if more than one of those entities is a candidate for being active, the one that is deemed most important or most critical will be selected first.
Changing Precedence
Viewpoint Workload Designer allows you to set the precedent order you wish by dragging and dropping individual planned environments. In the state matrix shown above, assume that the Planned Environments are in the order in which they were created, with Monday being the right-most as it was add most recently. But if you your business dictated that MonthEnd processing was more important and should be in effect during the times when Monday ended up being at the end of the month (a two-way tie), then you would want to drag EndOfMonth over to the right-most position. You state matrix would then look like this:
Note that when you drag a Planned Environment to a different position, the cells below it that represent the states associated with that Planned Environment are moved as well.
In addition to looking at your Workload Designer screens, you can also see which Planned Environment has the highest precedence amongst two that might overlap by looking at tdwmdmp -a output.
Under the heading "State and Event Information" tdwmdmp output will show you each Operating Environment (AKA Planned Environment) that is available, with their precedence order. If more than one is eligible, the one with the higher precedence wins. In the output below, the EndOfMonth Planned Environment will win if another Planned Environment is triggered at the same time.
Tdwmdmp -a also tells you the current Planned Environment.
State and Event Information:
Operational Environments:
PRECE OPENV OPERATING ENVIRONMENT
DENCE ID NAME ENAB CURR DFLT
----- ------ -------------------------- ---- ---- ----
4 77 EndOfMonth Yes
3 74 Monday Yes Yes
2 75 Weekday Yes
1 76 Always Yes Yes