Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1788841
  • 博文数量: 335
  • 博客积分: 4690
  • 博客等级: 上校
  • 技术积分: 4341
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-08 21:38
个人简介

无聊之人--除了技术,还是技术,你懂得

文章分类

全部博文(335)

文章存档

2016年(29)

2015年(18)

2014年(7)

2013年(86)

2012年(90)

2011年(105)

分类: 其他平台

2013-04-14 21:43:35


SMF 内容简介,它作为Z/OS最重要的component 之一,作用是不可替代的,下面我们从进行一个简单的介绍并给出一个配置实例:
阅读如下内容,对你后期理解DB2的trace还是有一定的帮助的,同时这也是系统运维人员的基本功之~~~~~~~~~~~~·
now  let's begin!
/*******************************************************************/
SMF  introduction  
/*******************************************************************/
System Management Facilities (SMF) – One of the 
strongest assets of MVS – Measurement Data!!!!
? Most common receptacle for recording z/OS activity
? SMF provides macros for applications to record 
information
? There is a standard heading format
? Each record is identified by a one-byte record number 
(ranging from 0 to 255) – 0-127 is reserved for IBM use
? Some records have subtypes
? A record might be identified as a type 30, subtype 4; or a 
30(4); or a 30.4 (most recent)
/*******************************************************************/
SMF  主要包含的内容
/*******************************************************************/
Major elements:
? Parameters specified in PARMLIB member SMFPRMxx
? Macros – used by applications to pass data to SMF and to 
interrogate parameters
? Exits – User-written exits to interrogate, change, or delete 
records as they are passed to SMF
? MVS commands – used to control the execution of SMF and 
to dynamically modify parameters
首先是参数配置:给一个实例如下:
从上图我们可以看到SMF的信息是在哪里进行配置,以及如何进行配置,而且这些配置信息本身有自说明的意义
SMF第二个比较重要的方面是macro:它是app用来传递record信息给SMF的,以及parameter  interrogation
第三个是exit,它主要是用户自定义函数,当这些某些信息从app传递给SMF时应该进行如何处理(delete,change,。。)(见示例 
IEFACTRT,.....)
第四部部分是 MVS 命令主要用来定义,生效,查看SMF信息情况:如:

从这里可以看出,MVS的命令信息同我们的配置信息是一致的。
/*******************************************************************/
SMF  usage:
/*******************************************************************/
Accounting and Chargeback
? Internally or to external customers (such as outsourcers)
? Performance Management
? Tuning devices, jobs, network, data sets, WLM
? Managing and reporting resources – CPU, external storage, 
memory, connections
? Configuration analysis
? Management reporting
? Problem identification
? Capacity Planning
? Collection of resource data for planning purposes
? Report
/*******************************************************************/
SMF  work flow ||  two ways of dealing with smf records
/*******************************************************************/



Applications use macros to pass records to the SMF writer
? The SMF writer uses parameters to determine which 
records to keep, and which exits to call, and then stores 
the records in a buffer
? Records are written from the buffer to either VSAM data 
sets formatted especially for SMF or to a logstream (but 
not both)
? The installation runs a program to extract the records from 
the data sets or logstream to create sequential files
? SMF files are used as input to reports and are often stored 
on data bases (SAS ITRM, MXG, and TDS are the most 
common)
SMF的结果可以直接写到VSAM文件或是,log stream,实际生产中以实用smf  log stream 方式居多。
下面给出这两个方式的一个简介:
SMF VSAM Data Sets
? Traditional recording method
? VSAM data sets that are pre-formatted
? SMF writes records to one of the VSAM data sets
? When the data set fills up, it calls an exit and switches to 
another formatted VSAM data set
? The exit usually issues a message to the operator and 
submits a job (usually IFASMFDP) to dump the records to 
a sequential data set and clear the VSAM data set
? The VSAM data set names are specified in SMFPRMxx
实用这种方式的缺点是:
SMF VSAM Data Sets
? There are several problems with SMF VSAM data sets:
? Data sets fill up and aren’t cleared, so data is lost
? The data sets can be easily overlaid (will explain later)
? Large volumes can overflow the buffers and/or the data sets
? Many sites have turned off records in order to reduce the 
volume
? A runaway or looping application can produce hundreds of 
thousands of records in a short amount of time that can 
cause overflows despite a robust configuration
? Lost data often translates to lost revenue
实用logger: 
SMF Logger
? SMF Logger introduced in z/OS 1.9
? SMF records to its buffer and also to a ‘logstream’ that 
resides in a coupling facility structure or a DASDONLY 
logstream
? Multiple LPARs can record to same structure or logstream
? You can record different record types to different 
logstreams
? This allows a higher write rate
? Can reduce the post-processing time
? Initially there were some problems with managing the records, but I believe those are all resolved
SMF Logger can avoid the problems indicated before
? Buffers are in 2 GB dataspaces (as many as needed), so that 
buffers don’t overflow
? Each dataspace is managed by its own task, so that the write 
rate is increased
? Logstreams are offloaded to DASD files as needed, so that 
you can’t run out of space
? The ability to separate record types onto different structures 
and logstreams can increase the write rate, as well as 
reducing post-processing time
/*******************************************************************/
SMF   parmlib  parameter
/*******************************************************************/
它的参数配置主要分为如下集中类型:
通用配置,file-related ,record-specific,buffer-related ,flood control,如果你对具体的参数配置敢兴趣,请参考red book
ACTIVE/NOACTIVE
Activate record collection
RECORDING(DATASET/LOGSTREAM)
Indicates whether SMF writes records to VSAM data sets or logstreams

DSNAME(xxx,. .,xxx/SYS1.MANX,SYS1.MANY)
Specifies names of VSAM data sets; try to use &SYSNAME or &SID

Record-specific parameters 
SYS(TYPE/NOTYPE(xx,xx:xx,xx(xx),0:255),
Defines which records to be written for all types of work (if not 
overridden)
INTERVAL(hhmmss/SMF/SMF,SYNC/NOSYNC)/NOINTERVAL,
Defines the interval for all types of work (if not overridden) for the type
30 (job-related) and type 32 (TSO) records
EXITS(. . .)/NOEXITS,
Defines whether (or which) exits are to be called for all types of 
work (if not overridden on SUBSYS)
DETAIL/NODETAIL)
For type 30 records, defines whether the EXCP sections are 
created for started tasks. For type 32 records, indicates 
whether resource usage (CPU, EXCP, etc.) are recorded for 
each TSO command (if no SUBSYS override)

/*******************************************************************/
SMF   实际操作 分别是针对VSAM  文件与 Log stream
/*******************************************************************/
IFASMFDP extracts SMF records from SMF VSAM data 
sets or sequential VBS files
? Can optionally clear (i.e. format) the SMF VSAM data sets
IFASMFDL extracts SMF records from the SMF logstream
? Can optionally delete records from the SMF logstream

上面说了这么,其实都是为了更好地理解如下内容:
? 100 – DB2 Statistics
? 101 – DB2 Accounting – can  account for 75% of all SMF
? 102 – DB2
也就是我们在DB2中进行问题分析,性能调优等所有的工作都是依赖于SMF 的正常工作的基础上,SMF将record dump到某一个文件,
然后我们使用特定的tool进行extract,从而进一步分析问题。

SMF Exits
? IEFACTRT – accounting exit called after step end and job end
? IEFU29 – called prior to dumping SMF from disk
? IEFU29L – called prior to dumping SMF from a logstream
? IEFU83 – called prior to writing an SMF record
? IEFU84 – called prior to writing an SMF record when branchentered and not in cross-memory mode
? IEFU85 – called prior to writing an SMF record when branchentered and in cross-memory mode
? IEFUJI – called at job initiation for validation
? IEFUJP – called before the type 26 record is written before job is purged from spool
IEFUJV/IEFUAV – called to validate JCL and APPC/MVS and 
can modify the JCL
? IEFUSI – called before step initiation
? IEFUSO – called when the job exceeds the spool output 
specified by the job class
? IEFUTL – called when the job exceeds the CPU time limit 
specified for the job class
? All exits are written in Assembler. Two products that produce 
exits without Assembler knowledge – OS/EM from Trident 
Services () and Easy/Exit from DTS Software 
ref: 


阅读(1893) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~