1、TXSeries(CICS) 培训,IBM Software 事务处理中间件,Agenda 日程安排,Know-Hows 基本概念回顾 CICS概念与原理 CICS安装与配置 How-Tos 常见问题分析 CICS运行与监控 CICS性能调整 CICS问题诊断 Q&A 答疑,CICS,Concepts 基本概念,概念1:交易,交易是对某一应用操作序列的一个工作单元(Logical Unit of Work) 特点(ACID): 原子性(Atomicity) 一致性(Consistency) 独立性(Isolation) 永久性(Durability),概念2:交易中间件,交易中间件是介于应用与
2、操作系统之间的系统软件 应用以交易中间件为开发、运行的基准平台,CICS历史,Customer Information Control System 1969年IBM CICS第一版发布 1993年IBM推出了UNIX平台的CICS产品 1998年IBM发布了TXSeries(CICS)产品 2002年TXSeries(CICS) V5.0 + PTF7 2004年TXSeries(CICS) V5.1,CICS Transactions Per Day,CICS can handle an incredible quarter of a million concurrent users. C
3、ICS processes over 30 billion transactions a day.,CICS与三层次应用,CICS Architecture 体系结构,IBM Software Group,CICS Region 系统,所有交易都是在CICS的应用服务器(cicsas)中运行,cicsas,cicsas,cicsas,cicsas,CICS Region控制进程,Application Server Processes,cicsam,cicsrl,cicsic,cicsld,cicsrm,cicsrs,cicsip,cicssl,Application Server Manag
4、er,RPC Listener,Interval Control Manager,Log Daemon,Recovery Manager,Recovery Server,Common Client Listener,Local SNA Listener,CICS Region的进程组成,CICS原理,Listeners,cicsas,cicsam,IBM Software Group,Listen Definition(LD) XA Definition(XAD) User Definition(UD) Communication Definition(CD) Program Definiti
5、on(PD) Transaction Definition(TD) Temporary Storage Definition(TSD) Transient Data Queue Definition(TDD) Journal Definition(JD) Monitor Definition(MD) File Definition(FD),Region资源管理,IBM Software Group,CICS on Open Systems Uses Multiple Processes,Region Pool RCA(CSA) & TCA Internal structures & table
6、s,Task Shared Pool CWA, TCTUA, BMS maps user tables, getmain shared,(read/write),(not addressable),Task Private Pool EIB, TWA, COMMAREA Stack, Heap, Working Storage getmain user storage,(read/write),Storage Management,IBM Software Group,CONNECTIONAPPLICATION LOGICSYNCPOINTTERMINATION(NORMAL ORABEND)
7、,XA 2 Phase,CICS COORDINATION PREPARE: COMMIT/ABORT PERSISTENTCONNECTION,XA 1 Phase,CICS COORDINATION COMMIT/ROLLBACKPERSISTENTCONNECTION,NON-XA,UNKNOWN STATEON ABENDNO CONNECTIONMANAGEMENT,CICS XAD,CICS XAD,NO CONNECTIONMANAGEMENT,BUSINESS LOGICSQL FETCH/UPDATE (NO CONNECTDISCONNECTCOMMITROLLBACK),
8、BUSINESS LOGICSQL FETCH/UPDATE(COMMIT ?)(ROLLBACK ?),SQL CONNECTBUSINESS LOGICSQL FETCH/UPDATESQL COMMIT SQL ROLLBACK SQL DISCONNECT,CICS SYNCPOINTIMPLICIT,CICS SYNCPOINTIMPLICIT,NO CICS COORDINATION,RDBMS Applications,CICS,SFS(Structured File Server),基于记录(records) User 用户SFS_SERV Device (LV 逻辑卷)sfs
9、_SFS_SERVlog_SFS_SERV,Binding File 绑定文件,SFS registered in DCE endpoint mapping ENCINA_BINDING_FILE /var/cics_servers/server_bindings /.:/cics/sfs/sbssfs ncadg_ip_udp:10050,SFS在DCE中的名字,通讯协议,端口,Region Directory Structure 目录结构,RD 定义,Application Server 应用服务器 Dynamics Min Server Max Server Storage Manage
10、ment 存储管理 Region Pool Task Shared Pool Task Private Pool,CICS,PD & TD 程序与交易,概念: Program vs. Transaction,Program 程序 完成一定功能的代码段 Transaction 交易 CICS程序运行的特定环境 本身无实际的代码 第一个程序(First Program),链接其他程序,Mirror Transaction 镜像交易,CPMI 0001,TClass 交易分类,不同的交易可以达到不同的并发度 Transaction Classify Class 1 10,CICS Security,
11、RSL: Resource Security Level TSL: Transaction Sercurity Level,CICS,Listener (LD) 侦听器,Listener,RPC Listenercicsrl Multithreads, Default: 10*MaxServer TCP/IP Listenercicsip Multithreads 3 threads for one terminal SNA Listenercicssl,TCP/IP Listener 定义,CICS,XA 接口,XA vs. Non-XA,CICS,Clients 客户端,CICS Clie
12、nt Architecture,CICS Universal Client,PATH AIX: /usr/lpp/cicscli HP-UX: /opt/cicsclicicscli CICSCLI.INIcclclnt (CICS Client Daemon, Multithread)cicsterm /s=$CICSREGION,cicsterm,CICS supplied 3270 emulator CICS supplied Transaction,CICS Supplied Transaction,CICS Supplied Transactions,CESF CICS Signof
13、f CEMT Configuration Management,CECI Command Interpreter CSTD Statistics Display,CICS Client 常见问题,CICS Universal Client CICS Client必须运行在ksh环境中 状态不显示或为connecting?cclclnt进程是否存在? 键入cclclnt后, 再运行cicscli /lipcsipcrm,CICS,Inter-System Communication 系统间通讯,ISC系统间通讯,ISC Network Protocol网络协议,cics_tcpppc_tcp,l
14、ocal_snappc_gateway,CICS,High Availability 高可用性,AIX HACMP,HA Tips 技巧,Identical userid & groupid numbers (NIS)cics sfsserver .cics cicsterm . /var/cics_servers/server_bindings/.:/cics/sfs/prod ncadg_ip_udp:8501 /etc/environment: Exclude the TCP/IP adapter / address for the standby adaptersRPC_UNSUPPO
15、RTED_NETADDRSRPC_UNSUPPORTED_NETIFS Shared volume groups & file system(s)/var/cics_regions, /var/cics_serversEncina raw logical volumes,CICS Region Creation,Primary Node Import CICS Volume Groups Normal CICS Configuration Steps Backup Node Create cics user and group(s) UID numbers must match Create
16、SRC and Encina Users only Use: cicssrccreate cicssrccreate -I -r regionName | -s SFSserverName -n serverId -u userId | -g ppcgwyServerName -n serverId -u userId cicssrcdestroy -r regionName | -s SFSserverName | -g ppcgwyServerName,HA日常维护,制订手工切换流程 制订脚本自动切换流程 定期进行HA正确性测试,CICS,Work Load Manager 负载均衡,Mu
17、ltiple Region Operation 多域运行,Application Isolation Increased Capacity Higher Availability,CICS,To Be a BEST CICS Administrator 系统管理,To Be a Best Administrator,明晰的概念(Idea) 不紊的条理(Action) 正确的习惯(Habit) 丰富的预案(Solution) 冷静的头脑(Head) 勤记录和多备份,Know how to use Document,Put CICS Documentation in your hand 准备好CI
18、CS文档 Know from where to get the information you want 清楚如何查阅手册 Make habits 养成习惯,CICS Administrator系统管理,Planning 规划 Installation 安装 Configuration 配置 Operating & Monitoring日常运行Performance Tuning 性能调整 Troubleshooting 问题诊断,CICS,Planning 规划,CICS Planning,CPU Memory Swap Space Disk LV File System /var/cics
19、_regions 1G Oracle processes,Min Server Max Server Region Pool Listener,Planning for AIX,Maximum number of PROCESSES allowed per user 最大进程数 1024 The Size of File System or LV /var/cics_regions /var/cics_servers application,Planning for HACMP,UserIDcics, SFS_SERV GroupIDcics, cicsterm Shared Resource
20、 ? SFS ? /var/cics_regions ? /var/cics_regions/BOCSBS,CICS,Installation 安装,User & Group,Groupcics, cicsterm Usercics, SFS_SERV,Environment Variable,$CICSREGION/environment AIX /etc/environment HP-UX /etc/profile,LANG PATH NLSPATHCICSREGION ENCINA_BINDING_FILE CICS_SFS_SERVER RPC_UNSUPPORTED_NETIFS ,
21、Installation,AIX smitty install Component Base Client Server,Useful Command,cicscp v create dce Rcicssfscreate S /.:/cics/sfs/sbssfs ShortName=SFS_SERVcicssimport r BOCSBS i region.bocsbs -S 配置CICS资源到SFS cicssfsconf -R wc BOCSBS DefaultFileServer=/.:/cics/sfs/sbssfscicscp -? 学会得到帮助!,CICS Command,cic
22、ssfscicssfslockcicssrccreatecicsrlckcicsnotify,启动TXSeries Server for AIX “cicscp -v start dce /*启动DCE*/cicscp -v start sfs_server $CICS_SFS_SERVER /*启动sfs_server*/cicscp -v start region $CICSREGION StartType=cold“/*启动TXSeries Region*/停止TXSeries Server for aix “cicscp -v stop region $CICSREGION /*停止T
23、XSeries Region*/cicscp -v stop sfs_server $CICS_SFS_SERVER /*停止SFS*/cicscp -v stop dce“ /*停止DCE*/ 查看TXSeries Server for AIX状态 “cicstail -r $CICSREGION“,TXSeries 管理操作,CICS,C 开发,CICS 应用开发,External Call Interface (ECI),CICS,Operating System 操作系统,Unix,Process vs. Thread 进程与线程 Message Queue Semaphore Sha
24、re Memory Performance Monitoring Tools 性能评测工具,Process Management,A process is a program in execution. A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task.,Thread,A thread (or lightweight process) is a basic unit of CPU utilization; it consist
25、s of: program counter register set stack spaceA thread shares with its peer threads its: code section data section operating-system resources collectively known as a task.A traditional or heavyweight process is equal to a task with one thread.,共享内存,信号量与消息队列,ipcsipcrm,AIX,topas,Tpis,Clean Library Cac
26、he on AIXslibclean,CICS,Performance Tuning 性能调整,Performance,Throughput 吞吐量 Throughput is a measure of the amount of work performed by a computer system over a period of time. Ex. database transactions per minute, web server hits per minute, disk I/O requests per second, . Response Time 响应时间 Response
27、 time is the elapsed time between the end of an inquiry ordemand on a computer system and the beginning of a response.,Which Part?,? OS ? CICS ? DB ? Application,OS,Main Memory Disk Paths & Devices Volume & File Placement Network Characteristics Processor Speed/Capacity,Unix Commands,vmstat global p
28、rocessor usage ps aux cpu by process iostat global disk activity filemon specific disk activity netstat network statistics sar system activity reports tprof detailed address reference profiling cicstrace detailed event trace iptrace detailed TCP/IP trace time time a specific command rmss squeeze rea
29、l memory monitor basic statistics (aixpdslib.seas.ucla.edu),AIX,Adequate memory & swap space Logical volume placement,CICS,Min/Max Application Servers Client Processing Pseudo Conversational Pgms Shared Application Text DCE Protection Levels Class Max Tasks Dynamic TR/DPL Routing,Min/Max Application
30、 Servers,l = ts * ta 平均交易时间 交易到达率 1035 Oracle/sessions,Class Max Tasks,Transaction Class (1-10) TD中定义 ClassMaxTask(RD) 同时执行的最大交易数 ClassMaxTaskLim(RD) 最大排队长度,DB,Database Optimization Tablespace Placement Lock patch,Performance Tuning Flowchart,CICS,Problem Determination 问题诊断,事故处理流程,保留事故现场 分析问题原因 提出问题
31、解决方案 测试 实施与回退,保留现场1,1 记录进程状态 ps -ef ps.out 2 记录机器运行状态vmstat 2 vmstat.out 3 记录网络连接状态 netstat -a | grep sbs netstat.out 4 记录DCE运行状态rpccp show mapping rpc.out,保留现场2,5 尝试在主服务器上登录CICS服务器cicsterm -r BOCSBS 如果登录尝试失败,记录错误信息或现象 如果登录尝试成功,在CICS终端界面内执行以下操作 6 检查当前连接终端状态CEMT I TERM把输出信息记录在文本文件term.out中 7 检查当前运行任务
32、状态CEMT I TASK 把输出信息记录在文本文件task.out中,保留现场3,8 产生CICS系统状态记录(DUMP)CEMT PERFORM SNAP 格式化DUMP文件(设DUMP文件名为SYSA0001.*) :cicsdfmt SYSA0001 dump.out 9 在前置机上尝试登录CICS服务器,如果失败,记录错误信息或现象。 10 记录可能发生问题的CICS进程状态:showProcInfo pid pid.out,保留现场4,11 重新启动CICS服务器前保留以下日志文件: /nacs/tmp/xa_NULL?.trc (?为当前日期) /var/cics_regions
33、/BOCSBS/console.* /var/cics_regions/BOCSBS/symrecs.* /var/cics_regions/BOCSBS/data/CCIN.out /var/cics_regions/BOCSBS/data/CSMT.out,保留现场5,12 如果发生故障期间在/var/cics_regions/BOCSBS/dumps/dir1目录下产生了其他错误记录文件,执行以下操作: DUMP文件 , 指在console文件中显示由CICS自动产生的DUMP文件,用cicsdfmt工具格式化,方法与步骤7类似。 Encina Buffer trace 文件, 用int
34、erpretTrace工具格式化并保留下来:interpretTrace BufferTrace.out,分析问题原因,收集相关信息 CICS OS AIX: errpt Oracle,CICS Error Messages,CICS Trace,Region Definition Trace all | none | partial TraceModules list ExternalTrace yes | no TraceFileA /path/file TraceFileB /path/file TraceFileSize 16M SysTraceBufferSize 16K UserTraceDirectory /path PublicUserTraceFile filename,CICS Trace Start,CEMT SET TRACE ON CECI TRACE SYSTEM ON CEMT SET AUXTRACE ON,CICS Trace Stop,CEMT SET AUXTRACE OFF CEMT SET TRACE OFF CECI TRACE SYSTEM OFF,