博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Advanced Diagnostic using oradebug dumpvar
阅读量:7060 次
发布时间:2019-06-28

本文共 7535 字,大约阅读时间需要 25 分钟。

oradebug工具是Oracle数据库调优和诊断的利器,合理运用oradebug可以大幅减少我们收集诊断信息所花费的时间。当然前提是合理运用,对于初级DBA有这样一个忠告,不要在生产环境中去接触或修改自己所不熟悉的领域的东西,这一点很重要。并不是说中高级DBA在知识和经验上能达到巨细靡遗的状态,实际上中高级Oracle DBA可能每天都在和新事物打交道。恰恰相反,中高级DBA是对以上忠告最忠实的践行者,在生产环境中绝不随意涉险于不确定、不明确、不熟悉的区域,很多时候这会让人觉得是一种"好奇心丧失"的表现。 言归正传,我们所要介绍的是oradebug的dumpvar命令,该命令用于打印转储固定的PGA/UGA/SGA的变量:,其语法如下:
oradebug dumpvarPrint/dump a fixed PGA/SGA/UGA variable.Syntax                                                              Parameteroradebug dumpvar 
[level]
PGA,SGA or UGA fixed variable name [level]使用示例SQL> select * from v$version;BANNER----------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64biPL/SQL Release 10.2.0.4.0 - ProductionCORE 10.2.0.4.0 ProductionTNS for Linux: Version 10.2.0.4.0 - ProductionNLSRTL Version 10.2.0.4.0 - ProductionSQL> select * from global_name;GLOBAL_NAME--------------------------------------------------------------------------------www.oracledatabase12g.comSQL> show parameter db_filesNAME TYPE VALUE------------------------------------ ----------- ------------------------------db_files integer 200SQL> oradebug setmypid;Statement processed.SQL> oradebug dumpvar sga kcfdpkkfil kcfdpk_ [698B950, 698B954) = 000000C8这里的KCFDPK变量保存了db_files参数的值,000000C8 == 200利用oradebug工具我们不仅可以做到对这些内部变量的窥视,还可以做到修改,但是这对我们实际的诊断没有益处,仅仅可以用来满足某些模拟实验
仅仅了解dumpvar命令的使用方法并没有意义,只有和有意义的内部变量结合起来才能真正起到高级诊断的作用,在这里抛砖引玉罗列出部分诊断变量:
sgauso --  该变量可以用于判断use_stored_outlinesSQL> oradebug setmypid;Statement processed.Default use_stored_outlines=false;SQL> oradebug dumpvar sga sgausoqolprm sgauso_ [060021418, 06002143C) =00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000SQL> alter system set use_stored_outlines=true;System altered.SQL> oradebug dumpvar sga sgausoqolprm sgauso_ [060021418, 06002143C) =00000001 45440007 4C554146 00000054 00000000 00000000 00000000 00000000 0000000045440007 4C554146 ==>      DEFAULT,意为优化器使用DEFAULT category中存放的outline.ksmvpa -- the size of the variable part of the pgaSQL> oradebug dumpvar pga ksmvpab4 ksmvpa_ [0068AA6B4, 0068AA6B8) = 0000E920          -- 59680 byteskkjsre        -- The SGA variable kkjsre must be 1 for jobs to execute automatically.SQL> oradebug  dumpvar sga kkjsreword kkjsre_ [060025760, 060025764) = 00000001SQL> exec  dbms_ijob.set_enabled(false);PL/SQL procedure successfully completed.SQL> oradebug  dumpvar sga kkjsreword kkjsre_ [060025760, 060025764) = 00000000kcmsmx          --the MAX reasonable scn SQL> oradebug dumpvar pga kcmsmxkscn kcmsmx_ [00B7E811C, 00B7E8124) = CA7F0000 00000C6C         -- 11.2.0.2SQL> oradebug dumpvar pga kcmsmxkscn kcmsmx_ [0068AB02C, 0068AB034) = A701C000 00000B3D         -- 10.2.0.4 Notice the MAX scn allowed on 11.2 is far higher that that at earlier releases(due to the fix from bug 9254170).Use the fix for 9254170 on ALL DBs with an SCN rate set to match between versions.Avoid excessive SCN generation rates.kcvlcm - logging checkpoints to alert - FALSESQL> show parameter log_checkpoints_to_alertNAME                                 TYPE        VALUE------------------------------------ ----------- ------------------------------log_checkpoints_to_alert             boolean     TRUESQL> oradebug dumpvar sga kcvlcmword kcvlcm_ [060019E88, 060019E8C) = 00000001SQL> alter system set log_checkpoints_to_alert=false;System altered.SQL> oradebug dumpvar sga kcvlcmword kcvlcm_ [060019E88, 060019E8C) = 00000000kcvcpr - false (a checkpoint is requested)SQL> oradebug dumpvar sga  kcvcprword kcvcpr_ [060019E90, 060019E94) = 00000000kcvcpf - false (checkpointing fast)kcvgcw -false a global checkpointing is waitingSQL> oradebug dumpvar sga kcvgcwsword kcvgcw_ [060025748, 06002574C) = 00000000kcfcpd - true if checkpoint writes donekcvblg  kcvblg[0] is s 1 incidate some file/s in backup modeSQL> oradebug dumpvar sga kcvblgub4 * kcvblg_ [060019E18, 060019E20) = 9A248508 00000000SQL> oradebug peek 0x9A248508 100[09A248508, 09A24856C) =00000001 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000002 0000000000000002 00000002 00000000 00000000 ...alter database begin backup;SQL>  oradebug peek 0x9A248508 100[09A248508, 09A24856C) =00000001 00000003 00000003 00000003 0000000300000003 00000003 00000003 00000003 0000000300000003 00000003 00000003 00000003 ...kcsgscn_           -- current scn SQL> oradebug dumpvar sga kcsgscn_kcslf kcsgscn_ [0600122B0, 0600122E0) =01C7DB4B 00000000 00000000 00000000              01C7DB4B  -- 298750190001E907 00000000 00000000 0000000000000000 00000000 60011F90 00000000              60011F90 is fixedSQL> select current_scn from v$database;CURRENT_SCN-----------   29875044kslwlst_  --  waiter list latchSQL> oradebug dumpvar sga kslwlstksllt kslwlst_ [200040AC, 20004174) =00000000 00000009 00000000 00000000 0000000000000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 ...kcfdfk -- 2 * db_filesSQL> oradebug dumpvar sga kcfdfkkfil kcfdfk_ [060017EF0, 060017EF4) = 00000190            --400    when db_files=200 SQL> alter system set db_files=2000 scope=spfile;System altered.SQL> oradebug dumpvar sga kcfdfkkfil kcfdfk_ [060017EF0, 060017EF4) = 00000FA0             --4000kcffsz  Address of Datafile Size So kcbzib() passes in information about how many blocks to read( and where to start reading from ) The assertion is   if (bno < 2 || bno + nblks - 1 > (kcflsz[fno] ? kcflsz[fno] : kcffsz[fno]))              ==============================================================              .......NOTE: This section is removed after 9g..................  {     /* if the user gave us the block number then this is an external error,      * but if the dba was internally generated then this is a corruption of      * some kind. */     ASSERTNM5(usrdba, OERINM("kcfrbd_2"),               fno, bno, nblks, kcflsz[fno], kcffsz[fno]);SQL> oradebug dumpvar sga kcffszub4 * kcffsz_ [060017F20, 060017F28) = 9988E700 00000000SQL> oradebug peek 0x9988E700 200[09988E700, 09988E7C8) =000000010007B200000309800000AF0000067CA00000320000280000000005000000000000000A0000000000000000000000060000040000 ...SQL> select blocks,to_char(blocks,'XXXXXXXX') hex_blocks from v$datafile;    BLOCKS HEX_BLOCK---------- ---------    504320     7B200    199040     30980     44800      AF00    425120     67CA0     12800      3200   2621440    280000      1280       500         0         0      2560       A00     38400      9600      6400      1900    BLOCKS HEX_BLOCK---------- ---------      1536       600    262144     4000013 rows selected.kcflsz -- like kcffszSQL> oradebug dumpvar  sga kcflszub4 * kcflsz_ [060017F28, 060017F30) = 99892588 00000000SQL> oradebug peek 0x99892588 200[099892588, 099892650) =00000000 0007B200 00030980 0000AF00 00067CA000003200 00280000 00000500 00000000 00000A0000000000 00000000 00000600 00040000 ...THe arguments are file number, block number, number of blocks, kcflsz[fno],kcffsz[fno]Error comes out of kcf.c.Can they try a validate structure cascade on this table and see what happens?Please update the customer field so that it does not read internal.
kcf.c kcf.c Kernel Cache Files component. ksl.c Kernel Service layer Latching & Wait-post Implement. ksm.c Kernel Service Memory component implementation. kkj.c Kernel Kompiletime Job queue.

转载地址:http://wbyll.baihongyu.com/

你可能感兴趣的文章
2017年最新企业面试题之shell(二)
查看>>
[毕业生的商业软件开发之路]现代商业软件开发概况
查看>>
android 反汇编,修改,重新打包
查看>>
mysql服务命令
查看>>
Openstack 之 安全关闭HA集群
查看>>
Oracle新建用户、角色,授权,建表空间的sql语句
查看>>
SICP 3.28 3.29 3.30
查看>>
C语言第二节课
查看>>
discuz文档说明注释
查看>>
cc_美团 商品详情图片放大显示ViewPager
查看>>
Postfix添加多端口
查看>>
IP地址详解
查看>>
如何在 TDrawGrid 的单元格中显示图片 - 回复 "巅枫" 的问题
查看>>
再学 GDI+[12]: 准备工作 - 矩形命中
查看>>
微软实战训练营[威武]公开课《解答Web Service和WCF、SOA经典面试题》
查看>>
Java服务端Cors跨域资源共享配置,解决与Spring Security冲突引起的问题
查看>>
二、 VUE2.0的环境搭建--创建工程
查看>>
逻辑卷管理器(LVM:Logical Volume Manager)
查看>>
Grizzly学习笔记(二)
查看>>
phpcms 一级导航的二级页面()
查看>>