Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

157

积分

0

好友

14

主题
1#
发表于 2012-6-1 09:57:32 | 查看: 4284| 回复: 1
数据库版本 11.2.0.2.0 linux x86-64
操作系统 RHEL 5.5
双节点集群

实例1 pid 48 level 10 的 processstate样例如下:


  1. ===================================================
  2. PROCESS STATE
  3. -------------
  4. Process global information:
  5.      process: 0x11c2c2828, call: (nil), xact: (nil), curses: (nil), usrses: 0x11c32a8f8
  6.      in_exception_handler: no
  7.   ----------------------------------------
  8.   SO: 0x11c2c2828, type: 2, owner: (nil), flag: INIT/-/-/0x00 if: 0x3 c: 0x3
  9.    proc=0x11c2c2828, name=process, file=ksu.h LINE:12451, pg=0
  10.   (process) Oracle pid:48, ser:152, calls cur/top: (nil)/0x110fbb350
  11.             flags : (0x0) -
  12.             flags2: (0x0),  flags3: (0x0)
  13.             intr error: 0, call error: 0, sess error: 0, txn error 0
  14.             intr queue: empty
  15.     ksudlp FALSE at location: 0
  16.   (post info) last post received: 0 0 78
  17.               last post received-location: kji.h LINE:3275 ID:kjata: wake up enqueue owner
  18.               last process to post me: 11c2aff28 1 6
  19.               last post sent: 0 0 26
  20.               last post sent-location: ksa2.h LINE:282 ID:ksasnd
  21.               last process posted by me: 11f30e4d0 1 6
  22.     (latch info) wait_event=0 bits=0
  23.     Process Group: DEFAULT, pseudo proc: 0x11c2f87d0
  24.     O/S info: user: grid, term: UNKNOWN, ospid: 23730
  25.     OSD pid info: Unix process pid: 23730, image: oracle@GG-rac1
  26.     ----------------------------------------
复制代码


对于calls cur/top以前的理解一直是current sql addr和top level call addr,惭愧一直没有实际验证过,今天一试发现并非如此
SELECT * FROM v$sql WHERE address='0000000110FBB350';
无法查到记录

谢谢
2#
发表于 2012-6-1 20:33:20
[oracle@maclean1 ~]$ ps -ef|grep dbw|grep -v grep
grid      4184     1  0 07:40 ?        00:00:00 asm_dbw0_+ASM1
oracle    4865     1  0 07:42 ?        00:00:00 ora_dbw0_PROD1


SQL> oradebug setospid 4865;
Oracle pid: 17, Unix process pid: 4865, image: oracle@maclean1.oracle.com (DBW0)


SQL> oradebug suspend;
Statement processed.

SQL> oradebug short_stack;
ksedsts()+461<-ksdxfstk()+32<-ksdxcb()+1876<-ksdxsus()+1101<-ksdxffrz()+40<-ksdxcb()+1876<-sspuser()+112<-__sighandler()<-semtimedop()+10<-skgpwwait()+160<-ksliwat()+1865<-kslwaitctx()+163<-kslwait()+141<-ksarcv()+207<-ksbabs()+330<-ksbrdp()+971<-opirip()+623<-opidrv()+603<-sou2o()+103<-opimai_real()+266<-ssthrdmain()+252<-main()+201<-__libc_start_main()+244<-_start()+36


SQL> oradebug dump errorstack 4;
Statement processed.


SQL> oradebug tracefile_name;
/s01/diag/rdbms/prod/PROD1/trace/PROD1_dbw0_4865.trc


PROCESS STATE
-------------
Process global information:
     process: 0x97896500, call: 0x97499ec8, xact: (nil), curses: 0x97439f70, usrses: 0x97439f70
     in_exception_handler: no
  ----------------------------------------
  SO: 0x97896500, type: 2, owner: (nil), flag: INIT/-/-/0x00 if: 0x3 c: 0x3
   proc=0x97896500, name=process, file=ksu.h LINE:12616, pg=0
  (process) Oracle pid:17, ser:1, calls cur/top: 0x97499ec8/0x97499ec8
            flags : (0x6) SYSTEM
            flags2: (0x800),  flags3: (0x10)
            intr error: 0, call error: 0, sess error: 0, txn error 0
            intr queue: empty
    ksudlp FALSE at location: 0
  (post info) last post received: 0 0 26
              last post received-location: ksa2.h LINE:285 ID:ksasnd
              last process to post me: 97892240 1 6
              last post sent: 0 0 125
              last post sent-location: kjc.h LINE:1904 ID:KJCS Post snd proxy to flush msg
              last process posted by me: 97892240 1 6
    (latch info) wait_event=0 bits=0
    Process Group: DEFAULT, pseudo proc: 0x9792e628
    O/S info: user: oracle, term: UNKNOWN, ospid: 4865
    OSD pid info: Unix process pid: 4865, image: oracle@maclean1.oracle.com (DBW0)
   
   
   
   
   
   
   
    call: 0x97499ec8  calls cur/top: 0x97499ec8/0x97499ec8
   
   
   
    call cur/top 一般指向当前的call state object


   
   
       SO: 0x97499ec8, type: 3, owner: 0x97896500, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
     proc=0x97896500, name=call, file=ksu.h LINE:12620, pg=0
    (call) sess: cur 97439f70, rec 0, usr 97439f70; flg:20 fl2:1; depth:0
    svpt(xcb:(nil) sptn:0x2 uba: 0x00000000.0000.00)
    ksudlc FALSE at location: 0
      ----------------------------------------
      SO: 0x970d9a98, type: 8, owner: 0x97499ec8, flag: INIT/-/-/0x00 if: 0x1 c: 0x1
       proc=0x97896500, name=enqueue, file=ksq1.h LINE:380, pg=0
      (enqueue) PW-00000001-00000000    DID: 0001-0011-00000005
      lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  res_flag: 0x3
      mode: SX, lock_flag: 0x10, lock: 0x970d9af0, res: 0x9718b5d0
      own: 0x97439f70, sess: 0x97439f70, proc: 0x97896500, prv: 0x9718b5e0
      slk: 0x9604c938
      ----------------------------------------
      SO: 0x970d8ba0, type: 8, owner: 0x97499ec8, flag: INIT/-/-/0x00 if: 0x1 c: 0x1
       proc=0x97896500, name=enqueue, file=ksq1.h LINE:380, pg=0
      (enqueue) DM-00000001-00000000    DID: 0001-0011-00000005
      lv: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  res_flag: 0x3
      mode: S, lock_flag: 0x10, lock: 0x970d8bf8, res: 0x97188818
      own: 0x97439f70, sess: 0x97439f70, proc: 0x97896500, prv: 0x97188828
      slk: 0x9604c3b0
      ----------------------------------------
      SO: 0x970d9638, type: 8, owner: 0x97499ec8, flag: INIT/-/-/0x00 if: 0x1 c: 0x1
       proc=0x97896500, name=enqueue, file=ksq1.h LINE:380, pg=0
      (enqueue) MR-000000C9-00000000    DID: 0001-0011-00000005
   
   

Call state object是针对一个call的,我们查看call state object的时候一定要注意depth值,以此判断该call是用户调用还是递归调用。

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-15 19:54 , Processed in 0.055727 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569