[20180619]oradebug peek.txt

简介: [20180619]oradebug peek.txt --//我以前一直以为oradebug peek查看某个地址开始的内容,后面的长度有限制的. --//在linux下,我的测试是60.

[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字节.但是剩下的单独转储.
--//这个可以作为转储内存块的信息.

目录
相关文章
|
SQL 关系型数据库 Oracle
[20180625]oradebug peek 2.txt
[20180625]oradebug peek 2.txt --//上个星期演示了oradebug peek查看内存数据块的情况,oradebug peek {address} length 1,最后的参数1可以实现转储到跟踪文件.
1307 0
|
Oracle NoSQL 关系型数据库
[20180510]sqlplus array 和 opifch2.txt
[20180510]sqlplus array 和 opifch2.txt --//我以前通过10046跟踪发现fetchsize的大小,一般在sqlplus下第1个总是1条,然后是arraysize大小.
1307 0
|
Oracle 关系型数据库 测试技术
[20180306]关于DEFERRED ROLLBACK.txt
[20180306]关于DEFERRED ROLLBACK.txt --//在oracle数据库存在一种特殊的ROLLBACK段,叫DEFERRED ROLLBACK.
1076 0
|
关系型数据库 Oracle Linux
[20180306]关于DEFERRED ROLLBACK2.txt
[20180306]关于DEFERRED ROLLBACK2.txt --//上午测试DEFERRED ROLLBACK针对表空间offline才有效,我测试回滚一定会写到DEFERRED ROLLBACK段.
993 0
|
关系型数据库 Oracle
|
Oracle 关系型数据库 缓存
|
测试技术 关系型数据库 Oracle
[20171106]DBMS_UTILITY.GET_TIME().txt
[20171106]DBMS_UTILITY.GET_TIME().txt --//有时候测试某个脚本运行时间,经常在这之前之后调用这个函数.今天奇怪的发现显示竟然是负数,感觉很奇怪做一个探究.
1030 0
|
Oracle 关系型数据库
[20170310]V$RMAN_OUTPUT的stamp 2.txt
[20170310]V$RMAN_OUTPUT的stamp 2.txt http://blog.itpub.net/267265/viewspace-1979123/ --//以前写的,今天才发现自己再次犯严重的错误.
933 0
|
数据库管理
[20160819]什么是DEFERRED ROLLBACK.txt
[20160819]什么是DEFERRED ROLLBACK.txt A "Deferred Rollback" segment is created for a tablespace when a tablespace is taken offline.
905 0