原則臨界值

您可以使用原則規則來定義數個不同類型的臨界值。部署具有相同臨界值的多個原則規則時,觸發規則的順序是先觸發 message 動作規則,再觸發 event 動作規則,最後觸發 abend 動作規則。

支援的規則類型詳細資料

表 1. 支援的規則類型詳細資料
規則類型  1  規則項目  2  運算子  3  單位  4 

資料庫要求

SQL 指令

大於

""
要求
K
千個要求

檔案要求

刪除
讀取
讀取下一個
讀取前一個
讀取更新
重新撰寫
開始瀏覽
寫入

大於

""
要求
K
千個要求

程式要求

鏈結

大於

""
要求
K
千個要求

儲存體

24 位元作業儲存體
31 位元作業儲存體
64 位元作業儲存體
24 位元共用儲存體
31 位元共用儲存體
64 位元共用儲存體

大於

B
位元組
K
KB
M
MB
G
GB

儲存體要求

24 位元作業儲存體要求
31 位元作業儲存體要求
64 位元作業儲存體要求
24 位元共用儲存體要求
31 位元共用儲存體要求
64 位元共用儲存體要求

大於

""
要求
K
千個要求

時間

CPU 限制

大於

O
微秒
M
毫秒
S
註: 當您在原則規則中選取單位並指定臨界值的值時,請注意精度會隨著單位大小的增加而降低。如果您發現無法使用較高的單位來指定夠高的值,則可能可以使用較低(較小)的單位來指定適當的值。比方說,如果您正在建立儲存體類型原則規則,而您無法使用 "G" (GB) 作為單位來設定臨界值,則可能可以改為使用 "M" (MB) 作為單位來設定臨界值,並在「原則」精靈中的欄位中輸入相等於 MB 的值。

範例

此範例列出儲存體及檔案要求原則的 XML。當作業配置超過 1024 位元組的 24 位元作業儲存體時,或當作業執行超過 50 次檔案讀取時,原則會發出訊息 DFHMP3001。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<policy:policy xmlns:policy="http://www.ibm.com/xmlns/prod/cics/managedplatform/policy" policySchemaRelease="0" policySchemaVersion="1">
   <description>Example platform policy to monitor task storage and file read counts</description>
   <userTag>exmp_1</userTag> thru <userTag>exmp_3</userTag>
   <rule type="storage" 1 > 
      <name>TooMuch24BitStorage</name> 
      <description>Issue DFHMP3001 msg when a task allocate more than 1024 bytes of 24 bit task storage</description>      
      <storageUsedCondition item="task24" 2  operator="GT" 3  value="1" unit="K" 4 />      
      <action>
         <message/>  
      </action> 
   </rule>
   <rule type="filerequest" 1 > 
      <name>TooManyReads</name> 
      <description>Issue DFHMP3001 msg when a task does more than 50 reads</description>      
      <fileRequestCondition item="read" 2  operator="GT" 3  value="50" unit="" 4 />
      <action>
         <message/>  
      </action> 
   </rule> 
</policy:policy>
此範例列出異常終止作業的檔案要求原則的 XML。此原則會在作業執行超過 10000 次檔案讀取時,異常終止具有預設異常終止碼 AMPB 的作業,或在作業執行超過 5000 次檔案寫入時,異常終止具有使用者指定異常終止碼 CFI1 的作業。訊息 DFHMP3002 會在異常終止時一起發出。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<policy:policy xmlns:policy="http://www.ibm.com/xmlns/prod/cics/managedplatform/policy" policySchemaRelease="0" policySchemaVersion="1">
   <description>Policy to monitor the number of file reads</description>
   <userTag>fcpol_1</userTag> 
   <rule type="filerequest" 1 > 
      <name>File_Reads</name> 
      <description>Abend the task if the file read limit exceeded</description>      
      <fileRequestCondition item="read" 2  operator="GT" 3  value="10" unit="K" 4 />      
      <action>
         <abend/>  
      </action> 
   </rule>
   <rule type="filerequest" 1 > 
      <name>File Write</name> 
      <description>Abend the task with specified abend code CFI1 if the file write limit exceeded</description>      
      <fileRequestCondition item="write" 2  operator="GT" 3  value="5" unit="K" 4 />
      <action>
         <abend abendCode="CFI1"/>  
      </action> 
   </rule> 
</policy:policy>
此範例列出發出事件的檔案要求原則的 XML。此原則會在作業執行超過 500 次檔案寫入時,將事件發出至名為 adapterB 的事件配接器,並在作業執行超過 100 次檔案讀取時,將事件發出至名為 adaSetA 的事件配接器集。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<policy:policy xmlns:policy="http://www.ibm.com/xmlns/prod/cics/managedplatform/policy" policySchemaRelease="0" policySchemaVersion="1">
   <description>Policy to monitor the number of file reads</description>
   <userTag>fcpol_1</userTag> 
   <rule type="filerequest" 1 > 
      <name>File Write</name> 
      <description>The file write limitation policy</description>      
      <fileRequestCondition item="write" 2  operator="GT" 3  value="500" unit="" 4 />      
      <action>
         <event>  
            <eventAdapterName>adapterB</eventAdapterName> 
         </event>  
      </action> 
   </rule>
   <rule type="filerequest" 1 > 
      <name>File_Reads</name> 
      <description>File read limitation policy</description>      
      <fileRequestCondition item="read" 2  operator="GT" 3  value="100" unit="" 4 />
      <action>
         <event>  
            <eventAdapterSetName>adaSetA</eventAdapterSetName> 
         </event>  
      </action> 
   </rule> 
</policy:policy>
如需如何將表 1 中所顯示的規則類型詳細資料對映至 XML 參數和值的相關資訊,請參閱原則 XML 元素名稱及屬性值