[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 ...
随机推荐
- PyTorch(二)Intermediate
Convolutional Neural Network import torch import torch.nn as nn import torchvision import torchvisio ...
- python之线程(threading)
线程是属于进程的,一个进程可能包含多个线程 至于线程和进程在使用时哪个更好,只能看使用的场景了 话不多说,看下线程模块(threading)的使用方法: #导入模块 import threading, ...
- 关于微信JS SDK接口wx.previewImage预览接口的使用
然后后之前的项目,突然往微信上迁移了,一些微信的接口没怎么用过,比较陌生,这次的功能是想调用微信的接口,实现图片放大的功能, 就找到官方文档:http://qydev.weixin.qq.com/wi ...
- mongodb 语句和SQL语句对应(SQL to Aggregation Mapping Chart)
SQL to Aggregation Mapping Chart https://docs.mongodb.com/manual/reference/sql-aggregation-compariso ...
- Android 系统内核层与 Linux Kernel 的比较
Android 内核具有和标准 Linux 内核一样的功能,主要实现了内存管理.进程调度.进程间通信等功能.但在文件系统.进程间通信.内存管理等方面存在差异. 1.文件系统.移动设备采用的大多不是硬盘 ...
- CentOS部署pyspider
0x00 环境 阿里云ECS云服务器 CPU:1核 内存:2G 操作系统:Centos 7.3 x64 地域:华北 2(华北 2 可用区 A) 系统盘:40G 0x01 安装依赖 yum instal ...
- Spring Boot + Spring Cloud 实现权限管理系统 后端篇(十五):系统服务监控
系统服务监控 新建监控工程 新建Spring Boot项目,取名 kitty-monitor,结构如下. 添加项目依赖 添加 spring boot admin 的相关依赖. pom.xml < ...
- MongoDB比较两列大小 使用$subtract函数
是找出整个表 a大于b的总数量,要怎么操作数据库呢,那就要用到$subtract函数 MongoDB比较两列大小 使用$subtract函数, // MongoDB 比较两列大小求出 啊>b 的 ...
- Effectively bypassing kptr_restrict on Android
墙外通道:http://bits-please.blogspot.com/2015/08/effectively-bypassing-kptrrestrict-on.html In this blog ...
- Django 学习笔记(五) --- Ajax 传输数据
人生苦短 ~ Tips:仅适用于 Python 3+(反正差别不大,py2 改改也能用).因为据 Python 之父 Guido van Rossum 说会在 2020 年停止对 Python 2 的 ...