[20180619]oradebug peek.txt
[20180619]oradebug peek.txt
--//我以前一直以为oradebug peek查看某个地址开始的内容,后面的长度有限制的.
--//在linux下,我的测试是60.实际上oradebug peek还支持1个参数,将看到的信息写入跟踪文件.
--//通过测试说明问题.
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
SCOTT@book> select rowid,dept.* from dept;
ROWID DEPTNO DNAME LOC
------------------ ---------- -------------- -------------
AAAVRCAAEAAAACHAAA 10 ACCOUNTING NEW YORK
AAAVRCAAEAAAACHAAB 20 RESEARCH DALLAS
AAAVRCAAEAAAACHAAC 30 SALES CHICAGO
AAAVRCAAEAAAACHAAD 40 OPERATIONS BOSTON
SCOTT@book> @rowid AAAVRCAAEAAAACHAAA
OBJECT FILE BLOCK ROW ROWID_DBA DBA TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
87106 4 135 0 0x1000087 4,135 alter system dump datafile 4 block 135 ;
SYS@book> @ bh 4 135
HLADDR DBARFIL DBABLK CLASS CLASS_TYPE STATE TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA OBJECT_NAME
---------------- ---------- ---------- ---------- ------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- --------------------
0000000084443EA0 4 135 1 data block xcur 1 0 0 0 0 0 0000000077136000 DEPT
--//BA=0000000077136000
2.使用oradebug观察
SYS@book> oradebug setmypid
Statement processed.
SYS@book> oradebug peek 0x77136000 64
[077136000, 077136040) = 0000A206 01000087 000E0EF0 06010000 0000E273 00160001 00015442 000E0EE4 1FE80000 00321F02 01000080 00020009 00000364 00C167B0 ...
SYS@book> oradebug peek 0x77136000 60
[077136000, 07713603C) = 0000A206 01000087 000E0EF0 06010000 0000E273 00160001 00015442 000E0EE4 1FE80000 00321F02 01000080 00020009 00000364 00C167B0 002E009A
--//可以发现显示60个字节.实际上最后加一个参数可以将内容写入跟踪文件,
SYS@book> oradebug peek 0x77136000 8192 1
[077136000, 077138000) = 0000A206 01000087 000E0EF0 06010000 0000E273 00160001 00015442 000E0EE4 1FE80000 00321F02 01000080 00020009 00000364 00C167B0 ...
SYS@book> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_9822.trc
--//检查跟踪文件内容:
*** 2018-06-22 08:49:41.349
Processing Oradebug command 'peek 0x77136000 8192 1'
[077136000, 077138000) = 0000A206 01000087 000E0EF0 06010000 0000E273 ...
Dump of memory from 0x077136014 to 0x077138000
077136010 00160001 00015442 000E0EE4 [....BT......]
077136020 1FE80000 00321F02 01000080 00020009 [......2.........]
077136030 00000364 00C167B0 002E009A 00002004 [d....g....... ..]
077136040 000E0EF0 00000000 00000000 00000000 [................]
077136050 00000000 00000000 00000000 00000000 [................]
077136060 00000000 00040100 001AFFFF 1F221F3C [............<.".]
077136070 00001F22 1F7E0004 1F541F68 18891F3C [".....~.h.T.<...]
077136080 17D1182D 172B177E 168516D8 15DF1632 [-...~.+.....2...]
077136090 1537158B 147F14DB 13C71423 13211374 [..7.....#...t.!.]
0771360A0 126912C5 11B1120D 10F91155 1041109D [..i.....U.....A.]
0771360B0 0F890FE5 0EE10F35 0E290E85 0D730DCE [....5.....)...s.]
0771360C0 0CBB0D17 0C0D0C64 0B670BBA 0AC10B14 [....d.....g.....]
0771360D0 0A1B0A6E 097509C8 08BF091A 0816086B [n.....u.....k...]
0771360E0 076007BB 06BC070E 0618066A 057205C5 [..`.....j.....r.]
0771360F0 04BA0516 04100465 00040002 00000012 [....e...........]
077136100 00000012 00000000 00000000 441A010B [...............D]
077136110 012B0000 00000D02 00000000 00C0820E [..+.............]
077136120 00400024 0040BBB4 004000F0 010512FF [$.@...@...@.....]
....
077137FA0 0203012C 4F0A29C1 41524550 4E4F4954 [,....).OPERATION]
077137FB0 4F420653 4E4F5453 0203012C 53051FC1 [S.BOSTON,......S]
077137FC0 53454C41 49484307 4F474143 0203012C [ALES.CHICAGO,...]
077137FD0 520815C1 41455345 06484352 4C4C4144 [...RESEARCH.DALL]
077137FE0 012C5341 0BC10203 4343410A 544E554F [AS,......ACCOUNT]
077137FF0 08474E49 2057454E 4B524F59 0EF00601 [ING.NEW YORK....]
*** 2018-06-22 08:49:41.356
Oradebug command 'peek 0x77136000 8192 1' console output:
[077136000, 077138000) = 0000A206 01000087 000E0EF0 06010000 0000E273 00160001 00015442 000E0EE4 1FE80000 00321F02 01000080 00020009 00000364 00C167B0 ...
--//缺点虽然现在显示偏移16字节(当然前面有显示前16字节.但是剩下的单独转储.
--//这个可以作为转储内存块的信息.