网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
本月文章推荐
.如何消除Oracle数据库的安全隐患.
.Oracle时间信息特性.
.如何在Oracle中发送Email.
.数据库 Oracle 11g 正式发布.
.oracle联机重定义表示例.
.Oracle学习手册:新手常见错误小.
.讲解删除部分控制文件后的数据库.
.通过JDBC连接oracle数据库.
.Oracle 的 in 和 not in ――性能.
.解决.NET连到Oracle的oci.dll加载.
.Reports产品简介.
.详细讲解Oracle中DECODE()函数的.
.杜绝安全隐患 容易忽视的Oracle安.
.TestKing Oracle 1Z0-132 Edt5.0.
.Linux之菜鸟日记(一).
.关於 Kernel 版本与 Distributio.
.一个比较全的simsun.ttf字体设置.
.ORACLE应用经验(2).
.如何将man page转成HTML格式.
.Oracle Database 10 g : 为 DBA .

分析诊断进程跟踪文件工具ASS.AWK(1)

发表日期:2008-2-9



  一个强大的分析诊断进程跟踪文件的工具ASS.AWK
  
  你可以使用下面方法产生系统状态跟踪文件
  
  process state dumps ==>一个进程的所有对象状态,假如确认哪个进程有问题,就用该方法
  
  system state dumps ==>整个系统的所有进程中的所有对象状态
  
  process state dumps
  ~~~~~~~~~~~~~~~~~~~~~
  1.ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME PROCESSSTATE LEVEL 10';
  
  2.event = '604 trace name processstate,level 10'
  
  3.oradebug setospid 进程ID
   oradebug dump processstate 10;
  
  system state dumps
  ~~~~~~~~~~~~~~~~~~~~~
  1.ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME SYSTEMSTATE LEVEL 10';
  
  2.event = '604 trace name systemstate,level 10'
  ass.awk的脚本
  ===========
  ass.awk
  ===========
  REM ------------------------------------------------------------------------------------------------
  REM #DESC   : Generate a formatted report from system state dump showing who's blocking whom
  REM Usage   : See below
  REM Description: Must run this script on the db server where the trace file resides
  REM ------------------------------------------------------------------------------------------------
  
  # Usage InstrUCtions
  # ~~~~~~~~~~~~~~~~~~
  # Usage: [n]awk -f ass.awk fname.trc  (But read the Portability Section !!)
  #
  # Configuring Ass:
  #
  #  By default, 'ass' attempts to dump as much information as possible and
  # assumes that the output is to be printed to screen. This means that 'ass'
  # runs in its slowest mode. Ass can be changed/speeded up by amending the
  # following variables in the BEGIN section :
  #
  #  interactive...........1 = show indication of processing [default]
  #             0 = don't show anything (faster)
  #  verbose...............1 = prints additional info    [default]
  #             0 = don't show info (faster)
  #  eventdetail...........1 = prints additional event info for selected events
  #               [default]
  #             0 = don't do the above (faster)
  #  skipbranch............1 = Skip 'branch of' state objects cause by SQL*NET
  #               loopback sessions etc (default)
  #             0 = don't skip 'branch of' transactions
  #  seqinfo...............1 = Output sequence number for WAITING processes
  #             0 = Do not dump seq# information.
  #
  # Portability
  # ~~~~~~~~~~~
  # 1) This uses the nawk extension of functions. Some variants of awk accept
  #   this (eg HP-UX v10) and others do not. Use nawk if awk fails !!
  #
  #   Alpha OSF/1  nawk     IBM RS/6000  awk
  #   Sun Solaris  nawk     HPUX     awk (v10) ???
(v9)
  #   Sun SunOS   nawk     Sequent    nawk
  #
  # 2) The Alpha version of awk can only handle 99 fields and will return
  #   a message like 'awk: Line ..... cannot have more than 99 fields'.
  #   The w/a: Either change the identified line or use a different platform.
  #
  # Known Restrictions
  # ~~~~~~~~~~~~~~~~~~
  # o The script assumes a certain structure to the System State. This means
  #  that this cannot be used on systemstates produced by MVS or VM.
  #  [To make it work the first two or three Words need to be stripped from]
  #  [each line in the systemstate trace file.               ]
  #
  # o This has been developed to work with Oracle7. It *may* work with Oracle
  #  version 6 but this has not been tested.
  #
  # o The code currently does not recognise processes that are CONVERTING locks.
  #  Eg, I have an SX lock and I am requesting the higher SSX mode.
  #  This will result in the process as waiting for a lock when it owns it. Note
  #  that if any other process has the resource locked then both are listed
  #  as holding the resource but a SELF-DEADLOCK is not flagged.
  #
  # o It looks like there may be a bug with listing processes that are
  #  blocking others because they have a buffer s.o. that others are waiting
  #  on.
  #
  # Coding Notes
  # ~~~~~~~~~~~~
  # o There's an obscure usage of building the blkres word list. It seems
  #  that you cannot just say : blkres[a,b] = blkres[a,b] " " newval
  #  You have to use a temporary variable ('tb' in our case) to achieve this.
  # o Sequent doesn't seem to like logical operators being used with regular
  #  eXPressions. Hence the 'wait event' section had to be re-written to use
  #  $0 ~ /a/ $0 ~ /b/. Just try the following test :
  #
  #    NR == 1 && /a/ /b/ { print }
  #
  # History
  # ~~~~~~~
  # kquinn.uk  v1.0.0 04/96  Created
  # kquinn.uk  v1.0.1 04/96  Minor changes to run with nawk on OSF1 and AIX
  #                Blocking Section's output changed slightly
  # kquinn.uk  v1.0.2 04/96  Dumps object names for library objects
  #                Now sequent-nawk aware
  #                First public release
  # kquinn.uk  v1.0.3 06/96  File I/O wait events now output file, block etc
  # kquinn.uk  v1.0.4 07/96  Parallel Query Dequeue Reason codes now output
  # kquinn.uk  v1.0.5 08/96  Added QC to QS code
  #                Added code to skip 'branch of' state objects
  # kquinn.uk  v1.0.5 03/97  Output Oracle command based on 'oct:' code.
  #                (Note that only the PARENT session's command
  #                code is output).
  #                Strip carriage returns (^M)
  # kquinn.uk  v1.0.6 10/97  Indicate dead processes
  # kquinn.uk  v1.0.7 09/98  Print some more wait information for certain
  #                wait events and handle waits on the sequence
  #                enqueue.
  # kquinn.uk  v1.0.8 12/98  Minor changes
  #                Changed to accomodate new systemstate format
  #                so that we identify the start of a systemstate
  #                correctly once more.
  #                Added seq# processing for waiting processes.
  #                Dumped more info for DFS lock acquisition
  #
  # Current Enhancement Requests Oustanding
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # o Pick out error code in PQO Queue Ref's
  # o Test concatenating all array elements so that we affectively use singular
  #  arrays. This may speed the processing depending upon how the implementation
  #  of awk uses multi-dimensional arrays.
  #
  ##############################################################################
  # Any failure cases or suggested improvements then please Email KQUINN.UK  #
  # with the details and the system state file (if relevant).         #
  ############################################################################## right">(出处:清风软件下载学院)
上一篇:一些常用的计划脚本(2) 人气:606
下一篇:Statspack使用中存在的几个误区 人气:567
浏览全部Oracle教程的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐