• 1. TXSeries(CICS) 培训 IBM Software 事务处理中间件
  • 2. Agenda 日程安排Know-Hows 基本概念回顾 CICS概念与原理 CICS安装与配置 How-Tos 常见问题分析 CICS运行与监控 CICS性能调整 CICS问题诊断 Q&A 答疑
  • 3. CICSConcepts 基本概念
  • 4. 概念1:交易交易是对某一应用操作序列的一个工作单元(Logical Unit of Work) 特点(ACID): 原子性(Atomicity) 一致性(Consistency) 独立性(Isolation) 永久性(Durability)
  • 5. 概念2:交易中间件交易中间件是介于应用与操作系统之间的系统软件 应用以交易中间件为开发、运行的基准平台
  • 6. 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
  • 7. CICS Transactions Per DayCICS can handle an incredible quarter of a million concurrent users. CICS processes over 30 billion transactions a day.
  • 8. CICS与三层次应用
  • 9. CICS Architecture 体系结构
  • 10. IBM Software Group CICS Region 系统所有交易都是在CICS的应用服务器(cicsas)中运行cicsascicsascicsascicsasCICS Region控制进程Application Server ProcessescicsamcicsrlcicsiccicsldcicsrmcicsrscicsipcicsslApplication Server ManagerRPC ListenerInterval Control ManagerLog DaemonRecovery ManagerRecovery ServerCommon Client ListenerLocal SNA ListenerCICS Region的进程组成
  • 11. CICS原理Listenerscicsascicsam
  • 12. IBM Software Group Listen Definition(LD) XA Definition(XAD) User Definition(UD) Communication Definition(CD) Program Definition(PD) Transaction Definition(TD) Temporary Storage Definition(TSD) Transient Data Queue Definition(TDD) Journal Definition(JD) Monitor Definition(MD) File Definition(FD)Region资源管理
  • 13. IBM Software Group CICS on Open Systems Uses Multiple ProcessesRegion Pool RCA(CSA) & TCA Internal structures & tablesTask 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
  • 14. IBM Software Group CONNECTION APPLICATION LOGIC SYNCPOINT TERMINATION (NORMAL OR ABEND)XA 2 PhaseCICS COORDINATION PREPARE: COMMIT/ABORT PERSISTENT CONNECTIONXA 1 PhaseCICS COORDINATION COMMIT/ROLLBACK PERSISTENT CONNECTIONNON-XA UNKNOWN STATE ON ABEND NO CONNECTION MANAGEMENTCICS XAD CICS XAD NO CONNECTION MANAGEMENTBUSINESS LOGIC SQL FETCH/UPDATE (NO CONNECT DISCONNECT COMMIT ROLLBACK) BUSINESS LOGIC SQL FETCH/UPDATE (COMMIT ?) (ROLLBACK ?) SQL CONNECT BUSINESS LOGIC SQL FETCH/UPDATE SQL COMMIT SQL ROLLBACK SQL DISCONNECTCICS SYNCPOINT IMPLICITCICS SYNCPOINT IMPLICITNO CICS COORDINATIONRDBMS ApplicationsCICS
  • 15. SFS(Structured File Server)基于记录(records) User 用户 SFS_SERV Device (LV 逻辑卷) sfs_SFS_SERV log_SFS_SERV
  • 16. 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中的名字通讯协议端口
  • 17. Region Directory Structure 目录结构
  • 18. RD 定义Application Server 应用服务器 Dynamics Min Server Max Server Storage Management 存储管理 Region Pool Task Shared Pool Task Private Pool
  • 19. CICSPD & TD 程序与交易
  • 20. 概念: Program vs. TransactionProgram 程序 完成一定功能的代码段 Transaction 交易 CICS程序运行的特定环境 本身无实际的代码 第一个程序(First Program),链接其他程序
  • 21. Mirror Transaction 镜像交易CPMI 0001
  • 22. TClass 交易分类不同的交易可以达到不同的并发度 Transaction Classify Class 1 ~ 10
  • 23. CICS SecurityRSL: Resource Security Level TSL: Transaction Sercurity Level
  • 24. CICSListener (LD) 侦听器
  • 25. ListenerRPC Listener cicsrl Multithreads, Default: 10*MaxServer TCP/IP Listener cicsip Multithreads 3 threads for one terminal SNA Listener cicssl
  • 26. TCP/IP Listener 定义
  • 27. CICSXA 接口
  • 28. XA vs. Non-XA
  • 29. CICSClients 客户端
  • 30. CICS Client Architecture
  • 31. CICS Universal ClientPATH AIX: /usr/lpp/cicscli HP-UX: /opt/cicscli cicscli CICSCLI.INI cclclnt (CICS Client Daemon, Multithread) cicsterm /s=$CICSREGION
  • 32. cicstermCICS supplied 3270 emulator CICS supplied Transaction
  • 33. CICS Supplied Transaction
  • 34. CICS Supplied TransactionsCESF CICS Signoff CEMT Configuration ManagementCECI Command Interpreter CSTD Statistics Display
  • 35. CICS Client 常见问题CICS Universal Client CICS Client必须运行在ksh环境中 状态不显示或为connecting? cclclnt进程是否存在? 键入cclclnt后, 再运行cicscli /l ipcs ipcrm
  • 36. CICSInter-System Communication 系统间通讯
  • 37. ISC系统间通讯
  • 38. ISC Network Protocol网络协议 cics_tcp ppc_tcp local_sna ppc_gateway
  • 39. CICSHigh Availability 高可用性
  • 40. AIX HACMP
  • 41. 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 adapters RPC_UNSUPPORTED_NETADDRS RPC_UNSUPPORTED_NETIFS Shared volume groups & file system(s) /var/cics_regions, /var/cics_servers Encina raw logical volumes
  • 42. CICS Region CreationPrimary Node Import CICS Volume Groups Normal CICS Configuration Steps Backup Node Create cics user and group(s) UID numbers must match Create 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]
  • 43. HA日常维护制订手工切换流程 制订脚本自动切换流程 定期进行HA正确性测试
  • 44. CICSWork Load Manager 负载均衡
  • 45. Multiple Region Operation 多域运行Application Isolation Increased Capacity Higher Availability
  • 46. CICSTo Be a BEST CICS Administrator 系统管理
  • 47. To Be a Best Administrator明晰的概念(Idea) 不紊的条理(Action) 正确的习惯(Habit) 丰富的预案(Solution) 冷静的头脑(Head) 勤记录和多备份
  • 48. Know how to use DocumentPut CICS Documentation in your hand 准备好CICS文档 Know from where to get the information you want 清楚如何查阅手册 Make habits 养成习惯
  • 49. CICS Administrator系统管理Planning 规划 Installation 安装 Configuration 配置 Operating & Monitoring日常运行 Performance Tuning 性能调整 Troubleshooting 问题诊断
  • 50. CICSPlanning 规划
  • 51. CICS PlanningCPU Memory Swap Space Disk LV File System /var/cics_regions >1G Oracle processesMin Server Max Server Region Pool Listener
  • 52. Planning for AIXMaximum number of PROCESSES allowed per user 最大进程数 1024 The Size of File System or LV /var/cics_regions /var/cics_servers application
  • 53. Planning for HACMPUserID cics, SFS_SERV GroupID cics, cicsterm Shared Resource ? SFS ? /var/cics_regions ? /var/cics_regions/BOCSBS
  • 54. CICSInstallation 安装
  • 55. User & GroupGroup cics, cicsterm User cics, SFS_SERV
  • 56. Environment Variable$CICSREGION/environment AIX /etc/environment HP-UX /etc/profileLANG PATH NLSPATH CICSREGION ENCINA_BINDING_FILE CICS_SFS_SERVER RPC_UNSUPPORTED_NETIFS …
  • 57. InstallationAIX smitty install Component Base Client Server
  • 58. Useful Command cicscp –v create dce –R cicssfscreate –S /.:/cics/sfs/sbssfs ShortName=SFS_SERV cicssimport –r BOCSBS –i region.bocsbs -S 配置CICS资源到SFS cicssfsconf -R wc BOCSBS DefaultFileServer=/.:/cics/sfs/sbssfs cicscp -? 学会得到帮助!
  • 59. CICS Command cicssfs cicssfslock cicssrccreate cicsrlck cicsnotify
  • 60. 启动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 /*停止TXSeries Region*/ cicscp -v stop sfs_server $CICS_SFS_SERVER /*停止SFS*/ cicscp -v stop dce" /*停止DCE*/ 查看TXSeries Server for AIX状态 "cicstail -r $CICSREGION"TXSeries 管理操作
  • 61. CICSC 开发
  • 62. CICS 应用开发
  • 63. External Call Interface (ECI)
  • 64. CICSOperating System 操作系统
  • 65. UnixProcess vs. Thread 进程与线程 Message Queue Semaphore Share Memory Performance Monitoring Tools 性能评测工具
  • 66. Process ManagementA process is a program in execution. A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task.
  • 67. ThreadA thread (or lightweight process) is a basic unit of CPU utilization; it consists of: – program counter – register set – stack space A 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.
  • 68. 共享内存,信号量与消息队列 ipcs ipcrm
  • 69. AIXtopas
  • 70. TpisClean Library Cache on AIX slibclean
  • 71. CICSPerformance Tuning 性能调整
  • 72. PerformanceThroughput 吞吐量 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 time is the elapsed time between the end of an inquiry ordemand on a computer system and the beginning of a response.
  • 73. Which Part?? OS ? CICS ? DB ? Application
  • 74. OSMain Memory Disk Paths & Devices Volume & File Placement Network Characteristics Processor Speed/Capacity
  • 75. Unix Commandsvmstat global processor 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 real memory monitor basic statistics (aixpdslib.seas.ucla.edu)
  • 76. AIXAdequate memory & swap space Logical volume placement
  • 77. CICSMin/Max Application Servers Client Processing Pseudo Conversational Pgms Shared Application Text DCE Protection Levels Class Max Tasks Dynamic TR/DPL Routing
  • 78. Min/Max Application Serversl = ts * ta 平均交易时间 交易到达率 10~35 Oracle/sessions
  • 79. Class Max TasksTransaction Class (1-10) TD中定义 ClassMaxTask(RD) 同时执行的最大交易数 ClassMaxTaskLim(RD) 最大排队长度
  • 80. DBDatabase Optimization Tablespace Placement Lock patch
  • 81. Performance Tuning Flowchart
  • 82. CICSProblem Determination 问题诊断
  • 83. 事故处理流程保留事故现场 分析问题原因 提出问题解决方案 测试 实施与回退
  • 84. 保留现场11 记录进程状态 ps -ef > ps.out 2 记录机器运行状态 vmstat 2 > vmstat.out 3 记录网络连接状态 netstat -a | grep sbs > netstat.out 4 记录DCE运行状态 rpccp show mapping > rpc.out
  • 85. 保留现场25 尝试在主服务器上登录CICS服务器 cicsterm -r BOCSBS 如果登录尝试失败,记录错误信息或现象 如果登录尝试成功,在CICS终端界面内执行以下操作 6 检查当前连接终端状态 CEMT I TERM 把输出信息记录在文本文件term.out中 7 检查当前运行任务状态 CEMT I TASK 把输出信息记录在文本文件task.out中
  • 86. 保留现场38 产生CICS系统状态记录(DUMP) CEMT PERFORM SNAP 格式化DUMP文件(设DUMP文件名为SYSA0001.*) : cicsdfmt SYSA0001 > dump.out 9 在前置机上尝试登录CICS服务器,如果失败,记录错误信息或现象。 10 记录可能发生问题的CICS进程状态: showProcInfo [pid] >pid.out
  • 87. 保留现场411 重新启动CICS服务器前保留以下日志文件: /nacs/tmp/xa_NULL??????.trc (??????为当前日期) /var/cics_regions/BOCSBS/console.* /var/cics_regions/BOCSBS/symrecs.* /var/cics_regions/BOCSBS/data/CCIN.out /var/cics_regions/BOCSBS/data/CSMT.out
  • 88. 保留现场512 如果发生故障期间在/var/cics_regions/BOCSBS/dumps/dir1目录下产生了其他错误记录文件,执行以下操作: DUMP文件 , 指在console文件中显示由CICS自动产生的DUMP文件,用cicsdfmt工具格式化,方法与步骤7类似。 Encina Buffer trace 文件, 用interpretTrace工具格式化并保留下来: interpretTrace BufferTrace.out
  • 89. 分析问题原因收集相关信息 CICS OS AIX: errpt Oracle
  • 90. CICS Error Messages
  • 91. CICS TraceRegion Definition Trace all | none | partial TraceModules [list] ExternalTrace yes | no TraceFileA /path/file TraceFileB /path/file TraceFileSize [16M] SysTraceBufferSize [16K] UserTraceDirectory /path PublicUserTraceFile filename
  • 92. CICS Trace StartCEMT SET TRACE ON CECI TRACE SYSTEM ON CEMT SET AUXTRACE ON
  • 93. CICS Trace StopCEMT SET AUXTRACE OFF CEMT SET TRACE OFF CECI TRACE SYSTEM OFF