[20180625]oradebug peek 2.txt
[20180625]oradebug peek 2.txt
--//上个星期演示了oradebug peek查看内存数据块的情况,oradebug peek {address} length 1,最后的参数1可以实现转储到跟踪文件.
--//以前也使用oradebug查看sql语句在共享池的父游标.采用拚接的方式查看.
--//如果使用上面的方式就简单了,测试看看.
--//以前的测试,链接:[20161230]查看父游标中sql语句.txt => http://blog.itpub.net/267265/viewspace-2131655/
1.环境:
SCOTT@book> @ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
2.查看父游标中sql语句:
SCOTT@book> select * from dept where deptno=10;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
--//多执行几次,保持sql语句光标在共享池中,确定sql_id= 4xamnunv51w9j.
SYS@book> @ &r/sharepool/shp4 4xamnunv51w9j 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ---------------------------------------- ---------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
子游标句柄地址 000000007B9C0FD8 000000007C6315A8 select * from dept where deptno=10 0 000000007C25EC10 000000007DBA6D20 4528 12144 3067 19739 19739 911274289 4xamnunv51w9j 0
父游标句柄地址 000000007C6315A8 000000007C6315A8 select * from dept where deptno=10 0 000000007D84C448 00 4720 0 0 4720 4720 911274289 4xamnunv51w9j 65535
--//父游标地址=000000007C6315A8
4.看看范围:
--//通过查询x$ksmsp确定范围
SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007C6315A8', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
ADDR INDX INST_ID KSMCHIDX KSMCHDUR KSMCHCOM KSMCHPTR KSMCHSIZ KSMCHCLS KSMCHTYP KSMCHPAR
---------------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------- -------- ---------- ----------------
00007FDE14C240E8 13208 1 1 1 KGLHD 000000007C631578 560 recr 80 00
--//可以确定范围: 0x000000007C631578,0x000000007C631578+560.
--//先看看sql语句转储的内容:
SCOTT@book> select dump('select * from dept where deptno=10',16) from dual ;
DUMP('SELECT*FROMDEPTWHEREDEPTNO=10',16)
--------------------------------------------------------------------------------------------------------------------
Typ=96 Len=34: 73,65,6c,65,63,74,20,2a,20,66,72,6f,6d,20,64,65,70,74,20,77,68,65,72,65,20,64,65,70,74,6e,6f,3d,31,30
--//我使用的cpu是intel系列的,存在大小头问题,在内存中看到的应该4个字节4个字节颠倒.前面4个应该是65,6c,65,73(16进制).
--//BTW: 我的测试oradebug peek最多查询60个字节.
SYS@book> oradebug setmypid
Statement processed.
SYS@book> oradebug peek 0x000000007C631578 560 1
[07C631578, 07C6317A8) = 00000231 80B38F00 7C631500 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00080050 803CBD30 00000000 ...
SYS@book> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_7077.trc
5.查看转储:
*** 2018-06-25 09:05:02.603
Processing Oradebug command 'peek 0x000000007C631578 560 1'
[07C631578, 07C6317A8) = 00000231 80B38F00 7C631500 00000000 00000000 ...
Dump of memory from 0x07C63158C to 0x07C6317A8
07C631580 00000000 [....]
07C631590 00000000 00000000 00000000 00000000 [................]
07C6315A0 00000000 00080050 803CBD30 00000000 [....P...0.<.....]
07C6315B0 803CBD30 00000000 7DBA6660 00000000 [0.<.....`f.}....]
07C6315C0 7C631700 00000000 00010000 10012841 [..c|........A(..]
07C6315D0 00000001 00000001 00010001 00000002 [................]
07C6315E0 00000000 00000005 00010000 00000000 [................]
07C6315F0 00000000 00000000 7C631778 00000000 [........x.c|....]
07C631600 00000001 00000000 7C631608 00000000 [..........c|....]
07C631610 7C631608 00000000 7C631618 00000000 [..c|......c|....]
07C631620 7C631618 00000000 7BF9D778 00000000 [..c|....x..{....]
07C631630 7BF9D778 00000000 7C631638 00000000 [x..{....8.c|....]
07C631640 7C631638 00000000 7D654A40 00000000 [8.c|....@Je}....]
07C631650 7D654A40 00000000 00000000 00000000 [@Je}............]
07C631660 00000001 00000000 4EAA74D5 00000000 [.........t.N....]
07C631670 0000F131 00000000 7C6316E8 00000000 [1.........c|....]
07C631680 7C631680 00000000 7C631680 00000000 [..c|......c|....]
07C631690 7C631690 00000000 7C631690 00000000 [..c|......c|....]
07C6316A0 00000000 00000000 7FC47F68 00000000 [........h.......]
07C6316B0 00000000 00000000 00000000 00000000 [................]
07C6316C0 00000003 00000001 00020002 00000000 [................]
07C6316D0 00000001 00000000 00000000 00000000 [................]
07C6316E0 00000000 00000000 00000000 00000000 [................]
07C6316F0 00000021 00000000 3650F131 00000000 [!.......1.P6....]
07C631700 1431C45D BDDBB9E7 4EAA74D5 3650F131 [].1......t.N1.P6]
07C631710 00000000 19067678 0011030A 00000000 [....xv..........]
07C631720 00000000 00000000 00000023 00000000 [........#.......]
07C631730 00000000 00000000 00000000 00000000 [................]
07C631740 7C631750 00000000 3650F131 00000053 [P.c|....1.P6S...]
07C631750 656C6573 2A207463 6F726620 6564206D [select * from de]
07C631760 77207470 65726568 70656420 3D6F6E74 [pt where deptno=]
07C631770 00003031 00000000 00000000 00000000 [10..............]
07C631780 00000000 00000000 00000000 00000000 [................]
Repeat 1 times
07C6317A0 00000000 00000000 [........]
--//可以发现sql语句的内容.
*** 2018-06-25 09:05:02.604
Oradebug command 'peek 0x000000007C631578 560 1' console output:
[07C631578, 07C6317A8) = 00000231 80B38F00 7C631500 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00080050 803CBD30 00000000 ...
*** 2018-06-25 09:05:12.659
Processing Oradebug command 'tracefile_name'
--//通过这样的方式提供快捷的方式查看内存地址的相关内容.
[20180625]oradebug peek 2.txt的更多相关文章
- [20180619]oradebug peek.txt
[20180619]oradebug peek.txt --//我以前一直以为oradebug peek查看某个地址开始的内容,后面的长度有限制的.--//在linux下,我的测试是60.实际上ora ...
- [20190423]oradebug peek测试脚本.txt
[20190423]oradebug peek测试脚本.txt --//工作测试需要写一个oradebug peek测试脚本,不断看某个区域内存地址的值. 1.环境: SCOTT@book> @ ...
- [20190402]关于semtimedop函数调用2.txt
[20190402]关于semtimedop函数调用2.txt --//前几天做了sql语句在mutexes上的探究.今天看看_mutex_wait_time设置很大的情况下是否semtimedop会 ...
- [20190423]简单测试latch nowilling等待模式.txt
[20190423]简单测试latch nowilling等待模式.txt --//我对这个问题的理解就是如果参数willing=0,表示无法获取该latch,直接退出,再寻找类似的latch.--/ ...
- [20190416]查看shared latch gets的变化.txt
[20190416]查看shared latch gets的变化.txt 1.环境:SYS@book> @ ver1PORT_STRING VERSION ...
- [20190416]exclusive latch测试脚本.txt
[20190416]exclusive latch测试脚本.txt --//昨天做了shared latch的测试脚本,今天完善exclusive latch测试脚本,上个星期的测试我是手工执行的.- ...
- [20190416]完善shared latch测试脚本2.txt
[20190416]完善shared latch测试脚本2.txt --//昨天测试shared latch,链接:http://blog.itpub.net/267265/viewspace-264 ...
- [20190415]关于shared latch(共享栓锁).txt
[20190415]关于shared latch(共享栓锁).txt http://andreynikolaev.wordpress.com/2010/11/17/shared-latch-behav ...
- [20190402]Library Cache mutex.txt
[20190402]Library Cache mutex.txt 1.环境:SCOTT@book> @ ver1PORT_STRING VERSION ...
随机推荐
- Java线程池(ThreadPoolExecutor)原理分析与使用
在我们的开发中"池"的概念并不罕见,有数据库连接池.线程池.对象池.常量池等等.下面我们主要针对线程池来一步一步揭开线程池的面纱. 使用线程池的好处 1.降低资源消耗 可以重复利用 ...
- Xamarin.Android 使用ListView绑定数据
使用ListView进行数据绑定 第一步:新建一个类,用于存储显示字段. namespace ListViewDataBIndDemo { public class Person { public i ...
- 课程五(Sequence Models),第一 周(Recurrent Neural Networks) —— 3.Programming assignments:Jazz improvisation with LSTM
Improvise a Jazz Solo with an LSTM Network Welcome to your final programming assignment of this week ...
- 线程安全-005-synchronized其他概念
一.Synchornized锁重入 例子程序: package com.lhy.thread01; public class SyncDouble1 { public synchronized voi ...
- Android多线程编程<二>Handler异步消息处理机制之Message
Message(消息): 一. Message的字段: 在Android中,Message作为线程之间(主要是子线程和UI主线程之间)数据交换的载体,通过Handler去传递.它 ...
- Java:类的构造函数
类的构造函数 类的构造函数特点: 1. 构造函数也称为构造方法,构造函数名和类名相同. 2. 构造函数不能有返回值,也不能用void声明. 3. 构造函数可以有参数,也可以无参数,在一个类 ...
- 滴滴工程师带你深入理解 TCP 握手分手全过程
本文作者:饶全成,中科院计算所硕士,滴滴出行后端研发工程师. 个人主页:https://zhihu.com/people/raoquancheng 记得刚毕业找工作面试的时候,经常会被问到:你 ...
- struts2 拦截器弊端
struts2 怎样在action内获得fielderror
- 详解C#异常处理
一.程序运行时产生的错误通过使用一种称为异常(Exception)的机制在程序中传递,通过异常处理(Exception Handling)有助于处理程序运行过程中发生的意外或异常情况:异常可由CLR和 ...
- Enumerable转换为DataTable
今天在项目组公共类库中发现一个 Enumerable类型转换为DataTable,写的挺精简的,拿出来跟大家共享一下. using System; using System.Collections.G ...