Chinaunix首页 | 论坛 | 博客
  • 博客访问: 104672951
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: DB2/Informix

2008-03-24 21:34:44


用户反馈前两天报告不全,今天报告查不到数据,于是到数据库查相关的表,果然没数据..^_^..
再查该表的来源,是通过perl跑出来的数据,通过定时任务执行,手工执行时提示有LONG TRANSACTION,解决方法如下。
 
一、登陆数据库服务器,切换到informix用户
infodb% su - informix
Password: 
Sun Microsystems Inc.   SunOS 5.8       Generic Patch   February 2004
You have new mail.
 
二、查看一下onstat工具的用法
onstat 应用程序的功能是读取共享内存的结构,提供执行该命令那一瞬间的统计数据。
在onstat 显示输出的过程中,共享内存的内容可能会发生变化。执行该操作不封锁共享内存,因此不会影响操作运行。
它是informix提供的一种交互式的系统监控工具。

infodb% onstat --
usage: onstat [ -abcdfghklmpstuxzBCDFRX ] [ -i ] [ -r [] ]
              [ -o [] ] [  ]
    -a    Print all info
    -b    Print buffers
    -c    Print configuration file
    -d [update]
          Print spaces and chunks
          update - Ask server to update BLOB chunk statistics
    -f    Print dataskip status
    -g    MT subcommand (see subcommands below)
    -i    Interactive mode
    -h    Print buffer hash chain info
    -j    Print interactive status of the active onpload process
    -k    Print locks
    -l    Print logging
    -m    Print message log
    -p    Print profile
    -s    Print latches
    -t    Print TBLspaces
    -u    Print user threads
    -x    Print transactions
    -z    Zero profile counts
    -B    Print all buffers
    -C    Print btree cleaner requests
    -D    Print spaces and detailed chunk stats
    -F    Print page flushers
    -G    Print global transaction ids
    -P    Print partition buffer summary
    -R    Print LRU queues
    -T    Print tablespace information
    -X    Print entire list of sharers and waiters for buffers
    -r    Repeat options every  seconds (default: 5)
    -o    Put shared memory into specified file (default: onstat.out)
    
          Read shared memory information from specified dump file
  MT COMMANDS:
    all   Print all MT information
    ath   Print all threads    
    wai   Print waiting threads
    act   Print active threads
    rea   Print ready threads
    sle   Print all sleeping threads
    spi   Print spin locks with long spins
    sch   Print VP scheduler statistics
    lmx   Print all locked mutexes
    lsc   Print Light Scan information
    wmx   Print all mutexes with waiters
    con   Print conditions with waiters
    stk 
          Dump the stack of a specified thread
    glo   Print MT global information
    mem [|]
          Print pool statistics.
    seg   Print memory segment statistics
    rbm   Print block map for resident segment
    nbm   Print block map for non-resident segments
    afr 
          Print allocated pool fragments
    ffr 
          Print free pool fragments
    ufr 
          Print pool usage breakdown
    iov   Print disk IO statistics by vp
    iof   Print disk IO statistics by chunk/file
    iog   Print AIO global information
    iob   Print big buffer usage by IO VP class 
    ppf [ | 0]   
          Print partition profiles
    tpf [ | 0]   
          Print thread profiles
    ntu   Print net user thread profile information
    ntt   Print net user thread access times              
    ntm   Print net message information
    ntd   Print net dispatch information 
    nss []
          Print net shared memory status
    nsc []
          Print net shared memory status
    nsd   Print net shared memory data
    sts   Print max and current stack sizes
    dic   Print dictionary cache information
    opn []
          Print open tables
    qst   Print queue statistics
    wst   Print thread wait statistics
    rwm   print Read/Write Mutex lists
    ses []
          Print session information
    sql []
          Print SQL information
    stq []
          Print stream queue information
    smb   Print smart-large-object usage
    dri   Print data replication information
    pos   Print /INFORMIXDIR/etc/.infos.DBSERVERNAME file
    mgm   Print Memory Grant Manager information
    lap   Print light append information
    ddr   Print DDR log post processing information
    env [ all | [] ] [[,...]]
          Display environment variable settings.
    dmp 
 
          Dump  bytes of shared memory starting at 

    src  
          Search memory for , where ==(memory&)
    dll   Print dynamic library statistics
    ssc [pool|all] 
          Prints ssc pool summary, or statement cache summary and
          entries, including key only entries (all)
    stm []
        Prints all prepared statements approximate memory usage in a session

主要选项说明如下:
-a 打印所有信息
-b 显示正在使用的缓冲区
-B 显示所有的缓冲区(不仅是正在使用的)
-c 显示ONCONFIG 文件内容,数据库首先检测你是否定义了环境变量
ONCONFIG,若有则显示 $INFORMIX/etc/$ONCONFIG 文件的内容,若未定义,则显示$INFORMIX/etc/onconfig文件的内容,此文件包含了许多系统需要的定义和设置。
-C 显示B+树清除(B+ tree cleaner)情况
-d 显示每个数据空间(dbspace)的块(chunk)信息
-D 显示每个数据空间头50个块的页(page)读写的情况
-F 显示每一种类型的写回磁盘(flush pages to disk)的统计数
-h 显示哈西链(hash chain)缓冲区信息
-i 进入onstat的交互方式,可直接敲入onstat命令,使用CTRL-d 退出交互方式
-k 显示活动锁(active lock)的信息
-l 显示物理日志和逻辑日志的信息
-m 显示20个系统最近用到的系统信息日志
-o file  将当前共享内存段内容写入指定文件,缺省为 onstat.out
-p 显示各项统计数
-r seconds 按指定秒数定期执行本次onstat命令,缺省为5秒,可用CTRL-c或DEL 键中止
-R 显示 LRU队列,FLRU队列,MLRU队列的详细信息
-t 显示活动(active)的表空间(tblspace)信息
-u 显示用户情况
-x 显示事务(transaction)信息
-X 显示正在共享(sharing)和等待(waiting)缓冲区的线索(thread)的精确信息
-z 将所有的统计计数置0
 
 
三、查看数据库状态
正常情况下是
infodb% onstat -
IBM Informix Dynamic Server Version 9.40.FC7     -- On-Line -- Up 35 days 16:51:16 -- 3920896 Kbytes
 
长事务情况下是
infodb% onstat -
IBM Informix Dynamic Server Version 9.40.FC7     -- On-Line (LONGTX) -- Up 35 days 16:41:40 -- 3920896 Kbytes
Blocked:LONGTX 
 

四、显示事务(transaction)信息
其中flag字段中第三个标志位为R说明事务在rollback,说明这个事务是长事务
infodb% onstat -x
IBM Informix Dynamic Server Version 9.40.FC7     -- On-Line (LONGTX) -- Up 35 days 16:41:56 -- 3920896 Kbytes
Blocked:LONGTX 
Transactions
address          flags userthread       locks  beginlg curlog  logposit   isol    retrys coord
1c8b2b028        A---- 1c8ae9028        0      0       119407  0x17e91cc  COMMIT  0      
1c8b2b298        A---- 1c8ae9850        0      0       0       0x0        COMMIT  0      
1c8b2b508        A---- 1c8aea078        0      0       0       0x0        COMMIT  0      
1c8b2b778        A---- 1c8aea8a0        0      0       0       0x0        COMMIT  0      
1c8b2b9e8        A---- 1c8aeb0c8        0      0       0       0x0        COMMIT  0      
1c8b2bc58        A---- 1c8aeb8f0        0      0       0       0x0        COMMIT  0      
1c8b2bec8        A---- 1c8aec118        0      0       0       0x0        COMMIT  0      
1c8b2c138        A---- 1c8aec940        0      0       0       0x0        COMMIT  0      
1c8b2c3a8        A---- 1c8aed168        0      0       0       0x0        COMMIT  0      
1c8b2c618        A---- 1c8aed990        0      0       0       0x0        COMMIT  0      
1c8b2c888        A---- 1c8aee1b8        0      0       0       0x0        COMMIT  0      
1c8b2cd68        A---- 1c8ae9028        0      0       0       0x0        NOTRANS 0      
1c8b2cfd8        A---- 1c8aefa30        0      0       0       0x0        COMMIT  0      
1c8b2d248        A---- 1c8afd668        1      0       0       0x0        COMMIT  0      
1c8b2d4b8        A---- 1cd56f3e0        1      0       0       0x0        COMMIT  0      
1c8b2de78        A---- 1c8b017a8        1      0       0       0x0        COMMIT  0      
1c8b2e0e8        A---- 1c8af4398        1      0       0       0x0        COMMIT  0      
1c8b2e358        A---- 1c8aef208        0      0       0       0x0        COMMIT  0      
1c8b2e5c8        A---- 1c8af84d8        1      0       0       0x0        COMMIT  0      
1c8b2eaa8        A---- 1cf1f45c8        1      0       0       0x0        COMMIT  0      
1c8b2ef88        A---- 1cf2083e0        1      0       0       0x0        COMMIT  0      
1c8b2f468        A---- 1cd54f208        1      0       0       0x0        COMMIT  0      
1c8b2f6d8        A---- 1cf1ff110        1      0       0       0x0        COMMIT  0      
1c8b2fe28        A---- 1c8b23a20        1      0       0       0x0        COMMIT  0      
1c8b30098        A---- 1cf205b18        1      0       0       0x0        COMMIT  0      
1c8b30308        A---- 1c8af8d00        1      0       0       0x0        COMMIT  0      
1c8b30cc8        A---- 1c8afeee0        1      0       0       0x0        COMMIT  0      
1c8b30f38        A---- 1c8afff30        1      0       0       0x0        COMMIT  0      
1c8b31688        A---- 1cf20b4d0        1      0       0       0x0        COMMIT  0      
1c8b31b68        A---- 1c8b01fd0        1      0       0       0x0        COMMIT  0      
1c8b31dd8        A---- 1c8afde90        1      0       0       0x0        COMMIT  0      
1c8b32048        A---- 1d4501df0        1      0       0       0x0        COMMIT  0      
1c8b32528        A---- 1cf220338        1      0       0       0x0        COMMIT  0      
1c8b32a08        A---- 1c8b09a28        1      0       0       0x0        DIRTY   0      
1c8b32ee8        A---- 1c8af0a80        1      0       0       0x0        COMMIT  0      
1c8b333c8        A---- 1cf1ff938        1      0       0       0x0        COMMIT  0      
1c8b34268        A---- 1c8af53e8        1      0       0       0x0        DIRTY   0      
1c8b344d8        A---- 1c8b081b0        1      0       0       0x0        DIRTY   0      
1c8b349b8        A---- 1cd553348        1      0       0       0x0        COMMIT  0      
1c8b35378        A---- 1c8b0a250        1      0       0       0x0        COMMIT  0      
1c8b355e8        A---- 1c8b0aa78        1      0       0       0x0        COMMIT  0      
1c8b35858        A---- 1c8b0b2a0        1      0       0       0x0        COMMIT  0      
1c8b35ac8        A---- 1c8b0bac8        1      0       0       0x0        COMMIT  0      
1c8b35d38        A---- 1c8b0c2f0        1      0       0       0x0        COMMIT  0      
1c8b35fa8        A---- 1c8b0cb18        1      0       0       0x0        COMMIT  0      
1c8b36218        A---- 1c8b0d340        1      0       0       0x0        COMMIT  0      
1c8b36488        A---- 1c8b0db68        1      0       0       0x0        COMMIT  0      
1c8b366f8        A---- 1c8b0e390        1      0       0       0x0        COMMIT  0      
1c8b36968        A---- 1c8b0ebb8        1      0       0       0x0        COMMIT  0      
1c8b36bd8        A---- 1c8b0f3e0        1      0       0       0x0        COMMIT  0      
1c8b36e48        A---- 1c8b0fc08        1      0       0       0x0        COMMIT  0      
1c8b370b8        A---- 1c8b10430        1      0       0       0x0        COMMIT  0      
1c8b37328        A---- 1c8b10c58        1      0       0       0x0        COMMIT  0      
1c8b37598        A---- 1c8b11480        1      0       0       0x0        COMMIT  0      
1c8b37808        A---- 1c8b11ca8        1      0       0       0x0        COMMIT  0      
1c8b37a78        A---- 1c8b124d0        1      0       0       0x0        COMMIT  0      
1c8b37ce8        A---- 1c8b12cf8        1      0       0       0x0        COMMIT  0      
1c8b37f58        A---- 1c8b13520        1      0       0       0x0        COMMIT  0      
1c8b381c8        A---- 1c8b13d48        1      0       0       0x0        COMMIT  0      
1c8b38438        A---- 1c8b14570        1      0       0       0x0        COMMIT  0      
1c8b386a8        A---- 1c8b14d98        1      0       0       0x0        COMMIT  0      
1c8b38918        A---- 1c8b155c0        1      0       0       0x0        COMMIT  0      
1c8b38b88        A---- 1c8b15de8        1      0       0       0x0        COMMIT  0      
1c8b38df8        A---- 1c8b16610        1      0       0       0x0        COMMIT  0      
1c8b39068        A---- 1c8b16e38        1      0       0       0x0        COMMIT  0      
1c8b392d8        A---- 1c8b17660        1      0       0       0x0        COMMIT  0      
1c8b39548        A---- 1c8b17e88        1      0       0       0x0        COMMIT  0      
1c8b397b8        A---- 1c8b186b0        1      0       0       0x0        COMMIT  0      
1c8b39a28        A---- 1c8b18ed8        1      0       0       0x0        COMMIT  0      
1c8b39c98        A---- 1c8b19700        1      0       0       0x0        COMMIT  0      
1c8b39f08        A---- 1c8b19f28        1      0       0       0x0        COMMIT  0      
1c8b3a178        A---- 1c8b1a750        1      0       0       0x0        COMMIT  0      
1c8b3a3e8        A---- 1c8b1af78        1      0       0       0x0        COMMIT  0      
1c8b3a658        A---- 1c8b1b7a0        1      0       0       0x0        COMMIT  0      
1c8b3a8c8        A---- 1c8b1bfc8        1      0       0       0x0        COMMIT  0      
1c8b3ab38        A---- 1c8b1c7f0        1      0       0       0x0        COMMIT  0      
1c8b3ada8        A---- 1c8b1d018        1      0       0       0x0        COMMIT  0      
1c8b3b018        A---- 1c8b1d840        1      0       0       0x0        COMMIT  0      
1c8b3b288        A---- 1c8b1e068        1      0       0       0x0        COMMIT  0      
1c8b3b4f8        A---- 1c8b1e890        1      0       0       0x0        COMMIT  0      
1c8b3b768        A---- 1c8b1f0b8        1      0       0       0x0        COMMIT  0      
1c8b3b9d8        A---- 1c8b1f8e0        1      0       0       0x0        COMMIT  0      
1c8b3bc48        A---- 1c8b20108        1      0       0       0x0        COMMIT  0      
1c8b3beb8        A---- 1c8b20930        1      0       0       0x0        COMMIT  0      
1c8b3c128        A---- 1c8b21158        1      0       0       0x0        COMMIT  0      
1c8b3c398        A---- 1c8b21980        1      0       0       0x0        COMMIT  0      
1c8b3c608        A---- 1c8b221a8        1      0       0       0x0        COMMIT  0      
1c8b3c878        A---- 1c8b229d0        1      0       0       0x0        COMMIT  0      
1c8b3cae8        A---- 1c8b231f8        1      0       0       0x0        COMMIT  0      
1c8b3cd58        A---- 1cf1fc848        1      0       0       0x0        COMMIT  0      
1c8b3cfc8        A---- 1c8b24248        1      0       0       0x0        COMMIT  0      
1c8b3d238        A---- 1c8b24a70        1      0       0       0x0        COMMIT  0      
1c8b3d4a8        A---- 1c8b25298        1      0       0       0x0        COMMIT  0      
1c8b3d718        A---- 1c8b25ac0        1      0       0       0x0        COMMIT  0      
1c8b3d988        A---- 1c8b262e8        1      0       0       0x0        COMMIT  0      
1c8b3dbf8        A---- 1c8b26b10        1      0       0       0x0        COMMIT  0      
1c8b3de68        A---- 1c8b27338        1      0       0       0x0        COMMIT  0      
1c8b3e0d8        A---- 1c8b28388        1      0       0       0x0        COMMIT  0      
1c8b3e348        A---- 1c8b27b60        1      0       0       0x0        COMMIT  0      
1c8b3e5b8        A---- 1c8b28bb0        1      0       0       0x0        COMMIT  0      
1cd4ca028        A---- 1c8b293d8        1      0       0       0x0        COMMIT  0      
1cd4ca298        A---- 1c8b29c00        1      0       0       0x0        COMMIT  0      
1cd4ca508        A---- 1cd549028        1      0       0       0x0        COMMIT  0      
1cd4ca778        A---- 1cd54a078        1      0       0       0x0        COMMIT  0      
1cd4ca9e8        A---- 1cd549850        1      0       0       0x0        COMMIT  0      
1cd4cac58        A---- 1cd54a8a0        1      0       0       0x0        COMMIT  0      
1cd4caec8        A---- 1cd54b0c8        1      0       0       0x0        COMMIT  0      
1cd4cb138        A---- 1cd54b8f0        1      0       0       0x0        COMMIT  0      
1cd4cb3a8        A---- 1cd54c118        1      0       0       0x0        COMMIT  0      
1cd4cb618        A---- 1cd54c940        1      0       0       0x0        COMMIT  0      
1cd4cb888        A---- 1cd54d168        1      0       0       0x0        COMMIT  0      
1cd4cbaf8        A---- 1cd54d990        1      0       0       0x0        COMMIT  0      
1cd4cbd68        A---- 1cd54e1b8        1      0       0       0x0        COMMIT  0      
1cd4cbfd8        A---- 1cd54e9e0        1      0       0       0x0        COMMIT  0      
1cd4cc248        A---- 1cd54fa30        1      0       0       0x0        COMMIT  0      
1cd4cc4b8        A---- 1cd57f8e0        1      0       0       0x0        COMMIT  0      
1cd4cc728        A---- 1cd550258        1      0       0       0x0        COMMIT  0      
1cd4cc998        A---- 1cf1e40c8        1      0       0       0x0        COMMIT  0      
1cd4ccc08        A---- 1cd5512a8        1      0       0       0x0        COMMIT  0      
1cd4cce78        A---- 1cd551ad0        1      0       0       0x0        COMMIT  0      
1cd4cd838        A---- 1cd553b70        1      0       0       0x0        COMMIT  0      
1cd4cdaa8        A---- 1cd554398        1      0       0       0x0        COMMIT  0      
1cd4cdd18        A---- 1cd554bc0        1      0       0       0x0        COMMIT  0      
1cd4cdf88        A---- 1cd5553e8        1      0       0       0x0        COMMIT  0      
1cd4ce468        A---- 1cd569a28        1      0       0       0x0        COMMIT  0      
1cd4ce6d8        A---- 1cd556c60        1      0       0       0x0        COMMIT  0      
1cd4cebb8        A---- 1cd557cb0        1      0       0       0x0        COMMIT  0      
1cd4cee28        A---- 1cd5584d8        1      0       0       0x0        COMMIT  0      
1cd4cf578        A---- 1cd559d50        1      0       0       0x0        COMMIT  0      
1cd4cf7e8        A---- 1cd55a578        1      0       0       0x0        COMMIT  0      
1cd4d0418        A---- 1cd55ce40        1      0       0       0x0        COMMIT  0      
1cd4d1048        A---- 1cd55f708        1      0       0       0x0        COMMIT  0      
1cd4d12b8        A---- 1cd55ff30        1      0       0       0x0        COMMIT  0      
1cd4d1528        A---- 1cd560758        1      0       0       0x0        COMMIT  0      
1cd4d1798        A---- 1cd560f80        1      0       0       0x0        DIRTY   0      
1cd4d1a08        A---S 1cd559528        1      0       0       0x0        COMMIT  0      userserver3
1cd4d1c78        A---- 1cd561fd0        1      0       0       0x0        COMMIT  0      
1cd4d1ee8        A---- 1cd5627f8        1      0       0       0x0        COMMIT  0      
1cd4d2158        A---- 1cd563020        1      0       0       0x0        COMMIT  0      
1cd4d23c8        A---- 1cd563848        1      0       0       0x0        COMMIT  0      
1cd4d2638        A---- 1cd564070        1      0       0       0x0        COMMIT  0      
1cd4d2d88        A---- 1cd5658e8        1      0       0       0x0        DIRTY   0      
1cd4d39b8        A---- 1cd5681b0        1      0       0       0x0        COMMIT  0      
1cd4d3c28        A---- 1cd5689d8        1      0       0       0x0        COMMIT  0      
1cd4d3e98        A---S 1cf1fd070        1      0       0       0x0        DIRTY   0      userserver3
1cd4d4108        A---S 1cf2157f0        1      0       0       0x0        COMMIT  0      userserver3
1cd4d45e8        A---- 1cd588bb0        1      0       0       0x0        DIRTY   0      
1cd4d4858        A---- 1cd56b2a0        1      0       0       0x0        COMMIT  0      
1cd4d4fa8        A---- 1cd56cb18        1      0       0       0x0        COMMIT  0      
1cd4d56f8        A---- 1cd56e390        1      0       0       0x0        COMMIT  0      
1cd4d5968        A---- 1cd56ebb8        1      0       0       0x0        COMMIT  0      
1cd4d60b8        A---- 1cd570430        1      0       0       0x0        COMMIT  0      
1cd4d6a78        A---- 1cd5724d0        1      0       0       0x0        COMMIT  0      
1cd4d6ce8        A---- 1cd572cf8        1      0       0       0x0        COMMIT  0      
1cd4d6f58        A---- 1cd573520        1      0       0       0x0        COMMIT  0      
1cd4d71c8        A---- 1cd573d48        1      0       0       0x0        COMMIT  0      
1cd4d7918        A-B-- 1d44fdcb0        2      119408  119408  0x39722c   DIRTY   0      
1cd4d7b88        A---- 1cd575de8        1      0       0       0x0        COMMIT  0      
1cd4d8068        A---- 1cd576e38        1      0       0       0x0        COMMIT  0      
1cd4d82d8        A---- 1cd577660        1      0       0       0x0        DIRTY   0      
1cd4d87b8        A---- 1cd5786b0        1      0       0       0x0        DIRTY   0      
1cd4d8a28        A---- 1c8af22f8        1      0       0       0x0        COMMIT  0      
1cd4d93e8        A---- 1cd57af78        1      0       0       0x0        DIRTY   0      
1cd4d9658        A---S 1cf1f9758        1      0       0       0x0        COMMIT  0      userserver3
1cd4d9b38        A---- 1cd550a80        1      0       0       0x0        COMMIT  0      
1cd4d9da8        A---- 1cd57d018        1      0       0       0x0        COMMIT  0      
1cd4da018        A---- 1cd57d840        1      0       0       0x0        COMMIT  0      
1cd4da288        A---- 1cd57e068        1      0       0       0x0        COMMIT  0      
1cd4da4f8        A---- 1cd57e890        1      0       0       0x0        COMMIT  0      
1cd4da768        A---- 1cd57c7f0        1      0       0       0x0        COMMIT  0      
1cd4da9d8        A---- 1c8afce40        1      0       0       0x0        COMMIT  0      
1cd4dac48        A---- 1cd580108        1      0       0       0x0        DIRTY   0      
1cd4daeb8        A---- 1cd580930        1      0       0       0x0        COMMIT  0      
1cd4db398        A---- 1cd581980        1      0       0       0x0        COMMIT  0      
1cd4db608        A---- 1cd5821a8        1      0       0       0x0        COMMIT  0      
1cd4db878        A---- 1cd5829d0        1      0       0       0x0        COMMIT  0      
1cd4dbae8        A---- 1cd5831f8        1      0       0       0x0        COMMIT  0      
1cd4dbd58        A---- 1cd583a20        1      0       0       0x0        COMMIT  0      
1cd4dbfc8        A---- 1cf1eec10        1      0       0       0x0        COMMIT  0      
1cd4dc238        A---- 1cf216840        1      0       0       0x0        COMMIT  0      
1cd4dc4a8        A---- 1cf203250        1      0       0       0x0        COMMIT  0      
1cd4dc718        A---- 1c8af5c10        1      0       0       0x0        COMMIT  0      
1cd4dcbf8        A---- 1cf1f5618        1      0       0       0x0        COMMIT  0      
1cd4dce68        A---- 1cd586b10        1      0       0       0x0        COMMIT  0      
1cd4dd0d8        A---- 1cf1ed398        1      0       0       0x0        COMMIT  0      
1cd4dd348        A---- 1c8b00758        1      0       0       0x0        COMMIT  0      
1cd4dd5b8        A---- 1c8b07160        2      0       0       0x0        COMMIT  0      
1cf09d028        A---- 1cf1f3578        1      0       0       0x0        COMMIT  0      
1cf09d298        A---- 1c8af0258        1      0       0       0x0        COMMIT  0      
1cf09d508        A---- 1cf1f2d50        1      0       0       0x0        COMMIT  0      
1cf09d778        A---- 1cd589c00        1      0       0       0x0        COMMIT  0      
1cf09dc58        A---- 1cf212f28        1      0       0       0x0        COMMIT  0      
1cf09e138        A---- 1cf1f5e40        1      0       0       0x0        COMMIT  0      
1cf09e3a8        A---- 1c8b03020        1      0       0       0x0        COMMIT  0      
1cf09e618        A---- 1cf1e38a0        1      0       0       0x0        COMMIT  0      
1cf09ed68        A---- 1cf1e9a80        1      0       0       0x0        COMMIT  0      
1cf09efd8        A---- 1cf219108        1      0       0       0x0        COMMIT  0      
1cf09f248        A---- 1cf1fe0c0        1      0       0       0x0        COMMIT  0      
1cf09f728        A---- 1cf1fafd0        1      0       0       0x0        COMMIT  0      
1cf09fc08        A---- 1cf1e8a30        1      0       0       0x0        COMMIT  0      
1cf09fe78        A---- 1cf1f2528        1      0       0       0x0        COMMIT  0      
1cf0a00e8        A---- 1c8b027f8        1      0       0       0x0        COMMIT  0      
1cf0a0358        A---- 1cf20cd48        1      0       0       0x0        COMMIT  0      
1cf0a05c8        A---- 1cf1f6668        1      0       0       0x0        COMMIT  0      
1cf0a0838        A---- 1cf204ac8        1      0       0       0x0        COMMIT  0      
1cf0a0d18        A---- 1cf1e5940        1      0       0       0x0        COMMIT  0      
1cf0a0f88        A---- 1cf1f7ee0        1      0       0       0x0        COMMIT  0      
1cf0a11f8        A---- 1c8af4bc0        1      0       0       0x0        COMMIT  0      
1cf0a16d8        A---- 1cf1eaad0        1      0       0       0x0        COMMIT  0      
1cf0a2308        A---- 1c8b07988        1      0       0       0x0        COMMIT  0      
1cf0a2578        A---- 1cf1e8208        1      0       0       0x0        COMMIT  0      
1cf0a27e8        A---- 1cd585ac0        1      0       0       0x0        COMMIT  0      
1cf0a2cc8        A---- 1cf1f4df0        1      0       0       0x0        COMMIT  0      
1cf0a2f38        A---- 1cf1ecb70        1      0       0       0x0        COMMIT  0      
1cf0a31a8        A---- 1cf20c520        1      0       0       0x0        COMMIT  0      
1cf0a3418        A---- 1cf1edbc0        1      0       0       0x0        COMMIT  0      
1cf0a3688        A---- 1cf1f76b8        1      0       0       0x0        COMMIT  0      
1cf0a38f8        A---- 1cf1ebb20        1      0       0       0x0        COMMIT  0      
1cf0a3b68        A---- 1cf1e71b8        1      0       0       0x0        COMMIT  0      
1cf0a3dd8        A---- 1cf20e5c0        1      0       0       0x0        COMMIT  0      
1cf0a4798        A---- 1cf20bcf8        1      0       0       0x0        COMMIT  0      
1cf0a4a08        A---- 1cd5893d8        1      0       0       0x0        COMMIT  0      
1cf0a4c78        A---- 1cf1e48f0        1      0       0       0x0        COMMIT  0      
1cf0a4ee8        A---- 1cf210e88        1      0       0       0x0        COMMIT  0      
1cf0a5158        A---- 1c8af3348        1      0       0       0x0        COMMIT  0      
1cf0a53c8        A---- 1cf202a28        1      0       0       0x0        COMMIT  0      
1cf0a5638        A---- 1cf1fa7a8        1      0       0       0x0        COMMIT  0      
1cf0a58a8        A---- 1cf200988        1      0       0       0x0        COMMIT  0      
1cf0a5b18        A---- 1cf1ee3e8        1      0       0       0x0        COMMIT  0      
1cf0a5d88        A---- 1c8afc618        1      0       0       0x0        COMMIT  0      
1cf0a5ff8        A---- 1cf21a980        1      0       0       0x0        COMMIT  0      
1cf0a6748        A-R-- 1cd55c618        642073 119403  119405  0x1aa91e4  DIRTY   0      
1cf0a69b8        A---- 1d44f7ad0        1      0       0       0x0        COMMIT  0      
1cf0a6c28        A---- 1cd587b60        1      0       0       0x0        COMMIT  0      
1cf0a7378        A---- 1cf1e9258        1      0       0       0x0        COMMIT  0      
1cf0a75e8        A---- 1cf20d570        1      0       0       0x0        COMMIT  0      
1cf0a7858        A---- 1cf1e3078        1      0       0       0x0        COMMIT  0      
1cf0a7d38        A---- 1cf1f0488        1      0       0       0x0        COMMIT  0      
1cf0a7fa8        A---- 1cd588388        1      0       0       0x0        COMMIT  0      
1cf0a8218        A---- 1cf20dd98        1      0       0       0x0        COMMIT  0      
1cf0a8968        A---- 1cf1f8708        1      0       0       0x0        COMMIT  0      
1cf0a8bd8        A---- 1cf206340        1      0       0       0x0        COMMIT  0      
1cf0a8e48        A---- 1cd584248        1      0       0       0x0        COMMIT  0      
1cf0a9328        A---- 1cf20f610        1      0       0       0x0        COMMIT  0      
1cf0a9808        A---- 1cf1fb7f8        1      0       0       0x0        COMMIT  0      
1cf0a9a78        A---- 1cd57f0b8        1      0       0       0x0        COMMIT  0      
1cf0a9ce8        A---- 1cf2011b0        1      0       0       0x0        COMMIT  0      
1cf0a9f58        A---- 1cf1f8f30        1      0       0       0x0        COMMIT  0      
1cf0aa1c8        A---- 1cd5862e8        1      0       0       0x0        COMMIT  0      
1cf0aa6a8        A---- 1cf1eb2f8        1      0       0       0x0        COMMIT  0      
1cf0aab88        A---- 1cf1fd898        1      0       0       0x0        COMMIT  0      
1cf0aadf8        A---- 1cf208c08        1      0       0       0x0        COMMIT  0      
1cf0ab068        A---- 1cf1f14d8        1      0       0       0x0        COMMIT  0      
1cf0aba28        A---- 1cf202200        1      0       0       0x0        COMMIT  0      
1cf0abc98        A---- 1cf1f1d00        1      0       0       0x0        COMMIT  0      
1cf0ac8c8        A---- 1cf2019d8        1      0       0       0x0        COMMIT  0      
1cf0acb38        A---- 1cf2052f0        1      0       0       0x0        COMMIT  0      
1cf0ad288        A---S 1d44f3168        1      0       0       0x0        COMMIT  0      userserver3
1cf0ad4f8        A---- 1cf217890        1      0       0       0x0        COMMIT  0      
1cf0adc48        A---- 1cf216018        1      0       0       0x0        COMMIT  0      
1cf0adeb8        A---- 1cf1efc60        1      0       0       0x0        COMMIT  0      
1cf0ae398        A---- 1cf1ec348        1      0       0       0x0        COMMIT  0      
1cf0ae608        A---- 1cd584a70        1      0       0       0x0        COMMIT  0      
1cf0ae878        A---- 1cf1f3da0        1      0       0       0x0        COMMIT  0      
1cf0aeae8        A---- 1cf1e5118        1      0       0       0x0        COMMIT  0      
1cf0aed58        A---- 1cf2147a0        1      0       0       0x0        COMMIT  0      
1cf0aefc8        A---- 1cf2188e0        1      0       0       0x0        COMMIT  0      
1cf0af238        A---- 1cf206b68        1      0       0       0x0        COMMIT  0      
1cf0af718        A---- 1cf207bb8        1      0       0       0x0        COMMIT  0      
1cf0af988        A---- 1cf209430        1      0       0       0x0        COMMIT  0      
1cf0b0348        A---- 1d44f0078        2      0       0       0x0        COMMIT  0      
1d3752c58        A---- 1d44fdcb0        0      0       0       0x0        NOTRANS 0      
1d37533a8        A---- 1cd56bac8        1      0       0       0x0        COMMIT  0      
1d37544b8        A---- 1d44f9348        1      0       0       0x0        COMMIT  0      
1d37555c8        A---- 1cd55c618        0      0       0       0x0        NOTRANS 0      
1d37566d8        A---S 1cd557488        1      0       0       0x0        COMMIT  0      dbserver3
1d3757098        A---S 1c8b09200        1      0       0       0x0        COMMIT  0      userserver3
1d3759ee8        A---- 1cd552b20        1      0       0       0x0        COMMIT  0      
 278 active, 512 total, 447 maximum concurrent
 

五、通过长事务的userthread值找出session id
infodb% onstat -u |grep 1cd55c618
1cd55c618        --RPX-- 1880841  informix -        0                0    642073 256446   323049
 

六、显示会话连接信息,找出造成长事务的SQL语句,并优化
infodb% onstat -g ses 1880841
IBM Informix Dynamic Server Version 9.40.FC7     -- On-Line (LONGTX) -- Up 35 days 16:42:40 -- 3920896 Kbytes
Blocked:LONGTX 
session                                      #RSAM    total      used       dynamic 
id       user     tty      pid      hostname threads  memory     memory     explain 
1880841  informix -        14283    infodb  1        417792     409528     off 
tid      name     rstcb            flags    curstk   status
1990929  sqlexec  1cd55c618        --RPX--  14095    sleeping(Forever)
Memory pools    count 1
name         class addr              totalsize  freesize   #allocfrag #freefrag 
1880841      V     1cadeb040        417792     8264       592        14        
name           free       used           name           free       used      
overhead       0          3248           mtmisc         0          80        
scb            0          144            opentable      0          38792     
filetable      0          5776           ru             0          600       
log            0          2184           temprec        0          10104     
keys           0          824            ralloc         0          278856    
gentcb         0          1592           ostcb          0          2872      
sort           0          136            sqscb          0          33384     
sql            0          72             rdahead        0          608       
hashfiletab    0          552            osenv          0          3240      
buft_buffer    0          5312           sqtcb          0          6696      
fragman        0          14144          shmblklist     0          152       
udr            0          160            
sqscb info
scb              sqscb            optofc   pdqpriority sqlstats optcompind  directives
1cdf2d028        1caf31028        0        0           0        0           1         
Sess  SQL            Current            Iso Lock       SQL  ISAM F.E.
Id    Stmt type      Database           Lvl Mode       ERR  ERR  Vers Explain    
1880841 INSERT         datadb               DR  Not Wait   0    0    9.03 Off        
Stored procedure stack :
   context            proc-counter       opcode name
   ------------------------------------------------------------------
   0x00000001cbbfde60 0x1cacfcde8+0x0010 SQL        datadb:datatodb
   0x00000001cbbfde60 0x1cacfcde8+0x0010 SQL        datadb:datatodb
Current SQL statement in procedure datadb:datatodb
   proc-counter 0x1cacfcde8 opcode SQL

insert into userdb:alarm_tbl(column_1,column_2......column_n)
  select column_1,column_2....column_n
    from table_b as b, table_a as a, outer(table_c as c)
    where a.column1=b.column and a.column_1=c.column_1......;

Last parsed SQL statement :
  execute procedure datatodb()
User-created Temp tables :
  partnum  tabname            rowsize 
  14000c5  c_list             38      
  14000c3  aa_list            34      
  14000c0  a_list             28 
阅读(1155) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~