[20171124]bbed的使用问题2.txt

简介: [20171124]bbed的使用问题2.txt --//bbed 是探究oracle数据块的好工具,有时候不用转储,直接可以它看oracle内部块的内部结构. --//在使用中要注意一些问题,昨天又犯类似错误,通过例子来说明: SCOTT@book> select rowid,dept.

[20171124]bbed的使用问题2.txt

--//bbed 是探究oracle数据块的好工具,有时候不用转储,直接可以它看oracle内部块的内部结构.
--//在使用中要注意一些问题,昨天又犯类似错误,通过例子来说明:

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> @ &r/rowid AAAVRCAAEAAAACHAAA
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- -------------------- ----------------------------------------
     87106          4        135          0  0x1000087           4,135                alter system dump datafile 4 block 135 ;

SCOTT@book> select OWNER,SEGMENT_NAME,SEGMENT_TYPE,HEADER_FILE,HEADER_BLOCK from dba_segments where owner=user and segment_name='DEPT';
OWNER  SEGMENT_NAME         SEGMENT_TYPE       HEADER_FILE HEADER_BLOCK
------ -------------------- ------------------ ----------- ------------
SCOTT  DEPT                 TABLE                        4          130

--//我曾经提到过:
--//如果我执行如下类似命令:
BBED> p tailchk dba 4,131
ub4 tailchk                                 @8188     0x0ee40602

BBED> p tailchk dba 4,130
BBED-00400: invalid blocktype (35)


BBED> p tailchk dba 4,131
BBED-00400: invalid blocktype (35)

--//我当时使用的方法是首先输入dba在前面.对于上面的命令你可以理解如下:
BBED> set dba 4,131
        DBA             0x01000083 (16777347 4,131)

BBED> p tailchk dba 4,130
BBED-00400: invalid blocktype (35)

BBED> show all
        FILE#           4
        BLOCK#          130
        OFFSET          8188
        DBA             0x01000082 (16777346 4,130)
        FILENAME        /mnt/ramdisk/book/users01.dbf
        BIFILE          bifile.bbd
        LISTFILE        /home/oracle/bbed/filelist.txt
        BLOCKSIZE       8192
        MODE            Edit
        EDIT            Unrecoverable
        IBASE           Dec
        OBASE           Dec
        WIDTH           160
        COUNT           64
        LOGFILE         log.bbd
        SPOOL           Yes
--//注意看show all现在显示的FILE#=4,BLOCK#=130.

BBED> p tailchk dba 4,131
BBED-00400: invalid blocktype (35)

--//当你再输入p tailchk dba 4,131时,实际上先访问dba 4,130,再去访问dba 4,131.
--//如果dba 4,130访问异常,就不会访问dba 4,131.执行出错.

BBED> p dba 4,131 tailchk
ub4 tailchk                                 @8188     0x0ee40602

--//我感觉bbed的执行方式最好按照帮助提示的要求输入参数.这样一般不会错.
--//比如显示P命令的执行方式:
BBED> help p
PRINT[/x|d|u|o|c] [ DBA | FILE | FILENAME | BLOCK | OFFSET | symbol | *symbol ]

--//最好按照显示参数的顺序输入基本没有问题,输入如下:
BBED> p  dba 4,131 tailchk
ub4 tailchk                                 @8188     0x0ee40602
--//可以直接读访问dba 4,131的tailchk.

BBED> p /d dba 4,131 tailchk
ub4 tailchk                                 @8188     249824770

BBED> p  filename '/mnt/ramdisk/book/users01.dbf'  block 131 tailchk
ub4 tailchk                                 @8188     0x0ee40602

--//如果写成如下:
BBED> p  filename '/mnt/ramdisk/book/users01.dbf'   tailchk block 131
ub4 tailchk                                 @0        0x0000a206
--//我根本不知道访问的是那个块.

--//dump也有类似的命令输入方式:

BBED> help dump
DUMP[/v] [ DBA | FILENAME | FILE | BLOCK | OFFSET | COUNT ]

BBED> dump /v filename '/mnt/ramdisk/book/users01.dbf' block 131 offset 0 count 256
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 131                               Offsets:    0 to  255                            Dba:0x01000083
-----------------------------------------------------------------------------------------------------------
06a20000 83000001 e40e0e00 00000204 5d700000 01000c00 42540100 e40e0e00 l ................]p......BT......
0000e81f 02003200 80000001 00000000 00000000 00000000 00000000 00000000 l ......2.........................
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 l ................................
00000000 00000000 ffff0e00 981f8a1f 8a1f0000 0000c819 73191e19 c5186c18 l ........................s.....l.
1018b417 5817fc16 a0164416 e8158c15 3215d814 7c142014 c6136c13 1913c612 l ....X.....D.....2...|. ...l.....
6b121012 ba116411 0811ac10 58100410 a80f4c0f f50e9d0e 430ee90d 970d450d l k.....d.....X.....L.....C.....E.
f10c9d0c 450ced0b 970b410b f50aa90a 4d0af109 a1095109 0109b108 5d080908 l ....E.....A.....M.....Q.....]...
bf077507 1f07c906 70061706 bb055f05 0b05b704 5c040104 b812c812 d812e812 l ..u.....p....._.....\...........
<32 bytes per line>

--//如果输入如下:
BBED> dump /v offset 0    count 256 filename '/mnt/ramdisk/book/users01.dbf' block 135
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 135                               Offsets:    0 to  255                            Dba:0x01000087
-----------------------------------------------------------------------------------------------------------
06a20000 87000001 70786917 03000204 56a50000 01001600 42540100 70786917 l ........pxi.....V.......BT..pxi.
0300e81f 021f3200 80000001 09000200 64030000 b067c100 9a002e00 00800000 l ......2.........d....g..........
f00e0e00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 l ................................
00000000 00010400 ffff1a00 261f221f 221f0000 04007e1f 261f541f 3c1f8918 l ............&.".".....~.&.T.<...
2d18d117 7e172b17 d8168516 3216df15 8b153715 db147f14 2314c713 74132113 l -...~.+.....2.....7.....#...t.!.
c5126912 0d12b111 5511f910 9d104110 e50f890f 350fe10e 850e290e ce0d730d l ..i.....U.....A.....5.....)...s.
170dbb0c 640c0d0c ba0b670b 140bc10a 6e0a1b0a c8097509 1a09bf08 6b081608 l ....d.....g.....n.....u.....k...
bb076007 0e07bc06 6a061806 c5057205 1605ba04 65041004 02000400 12000000 l ..`.....j.....r.....e...........

<32 bytes per line>

BBED> dump /v offset 8000    count 256 filename '/mnt/ramdisk/book/users01.dbf' block 135
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 135                               Offsets:    0 to  255                            Dba:0x01000087
-----------------------------------------------------------------------------------------------------------
06a20000 87000001 70786917 03000204 56a50000 01001600 42540100 70786917 l ........pxi.....V.......BT..pxi.
0300e81f 021f3200 80000001 09000200 64030000 b067c100 9a002e00 00800000 l ......2.........d....g..........
f00e0e00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 l ................................
00000000 00010400 ffff1a00 261f221f 221f0000 04007e1f 261f541f 3c1f8918 l ............&.".".....~.&.T.<...
2d18d117 7e172b17 d8168516 3216df15 8b153715 db147f14 2314c713 74132113 l -...~.+.....2.....7.....#...t.!.
c5126912 0d12b111 5511f910 9d104110 e50f890f 350fe10e 850e290e ce0d730d l ..i.....U.....A.....5.....)...s.
170dbb0c 640c0d0c ba0b670b 140bc10a 6e0a1b0a c8097509 1a09bf08 6b081608 l ....d.....g.....n.....u.....k...
bb076007 0e07bc06 6a061806 c5057205 1605ba04 65041004 02000400 12000000 l ..`.....j.....r.....e...........

<32 bytes per line>
--//第一次执行是正确的,而第2次就不对了(offset还是0).

--//如果按照dump帮助的顺序输入参数,就不会出问题了.
BBED> help dump
DUMP[/v] [ DBA | FILENAME | FILE | BLOCK | OFFSET | COUNT ]

BBED> dump /v filename '/mnt/ramdisk/book/users01.dbf' block 135 offset 0    count 256
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 135                               Offsets:    0 to  255                            Dba:0x01000087
-----------------------------------------------------------------------------------------------------------
06a20000 87000001 70786917 03000204 56a50000 01001600 42540100 70786917 l ........pxi.....V.......BT..pxi.
0300e81f 021f3200 80000001 09000200 64030000 b067c100 9a002e00 00800000 l ......2.........d....g..........
f00e0e00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 l ................................
00000000 00010400 ffff1a00 261f221f 221f0000 04007e1f 261f541f 3c1f8918 l ............&.".".....~.&.T.<...
2d18d117 7e172b17 d8168516 3216df15 8b153715 db147f14 2314c713 74132113 l -...~.+.....2.....7.....#...t.!.
c5126912 0d12b111 5511f910 9d104110 e50f890f 350fe10e 850e290e ce0d730d l ..i.....U.....A.....5.....)...s.
170dbb0c 640c0d0c ba0b670b 140bc10a 6e0a1b0a c8097509 1a09bf08 6b081608 l ....d.....g.....n.....u.....k...
bb076007 0e07bc06 6a061806 c5057205 1605ba04 65041004 02000400 12000000 l ..`.....j.....r.....e...........

<32 bytes per line>

BBED> dump /v filename '/mnt/ramdisk/book/users01.dbf' block 135 offset 8000 count 256
File: /mnt/ramdisk/book/users01.dbf (4)
Block: 135                               Offsets: 8000 to 8191                            Dba:0x01000087
-----------------------------------------------------------------------------------------------------------
ff0180ff 018004c3 07382402 c1022c00 1204c306 2423ff01 80196a61 76612f6e l .........8$...,.....$#....java/n
65742f55 524c436c 6173734c 6f616465 72243402 c102ff02 c11e0778 7108180c l et/URLClassLoader$4........xq...
2e120778 7108180c 2e122c00 0302c115 08524553 45415243 48064441 4c4c4153 l ...xq.....,......RESEARCH.DALLAS
2c000302 c1290a4f 50455241 54494f4e 5306424f 53544f4e 2c000302 c11f0553 l ,....).OPERATIONS.BOSTON,......S
414c4553 07434849 4341474f 3c020302 c1150852 45534541 52434806 44414c4c l ALES.CHICAGO<......RESEARCH.DALL
41532c00 0302c10b 0a414343 4f554e54 494e4708 4e455720 594f524b 02067078 l AS,......ACCOUNTING.NEW YORK..px

<32 bytes per line>

目录
相关文章
|
Oracle 关系型数据库 OLAP
[20180628]expdp与rows=n.txt
[20180628]expdp与rows=n.txt --//想导出一些表结构,使用错参数rows=n,才发现expdp会自动修正这个错误,使用content=metadata_only代替.
1831 0
|
Oracle 关系型数据库 数据库管理
[20180619]bbed verify问题.txt
[20180619]bbed verify问题.txt --//记录一下自己一个多年的错误. 1.环境: SCOTT@test01p> @ ver1 PORT_STRING                    VERSION        BANNER   ...
1288 0
|
数据库管理
[20180205]使用bbed相关问题.txt
[20180205]使用bbed相关问题.txt --//上个星期5使用bbed修改块遇到一些问题,做一个记录: 1.环境: SCOTT@book> @ ver1 PORT_STRING                    VERSION       ...
968 0
|
Oracle 关系型数据库 Linux
[20180115]RMAN-06820.txt
[20180115]RMAN-06820.txt --//在备库做归档备份出现RMAN-06820的问题。就是如果在备库做全表,因为要做主库日志切换,一般执行rman target /会出现问题。
1420 0
|
Oracle 关系型数据库 测试技术
[20171225]RMAN-06808.txt
[20171225]RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect.txt --//朋友拿我的一些例子来测试遇到的RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect问题.
951 0
|
关系型数据库
[20171221]RMAN-05501.txt
[20171221]RMAN-05501 aborting duplication of target database.txt --//昨天使用rman duplicate建立dg,出现如下错误: rman > duplicate target database for standby from active database; .
1070 0
|
Oracle 关系型数据库
[20171130]关于rman的一些总结.txt
[20171130]关于rman的一些总结.txt --//最近一直做rman相关测试,测试那个乱,没办法.无法从周围的人获得帮助,纯粹是自己的乱猜,乱测,不知道别人是否能看懂我写的东西.
1090 0
|
Oracle 关系型数据库 API
[20170208]rman tape.txt
[20170208]rman tape.txt --前一阵子,同事测试使用磁带做rman备份,留下一些备份信息在控制文件,要清除. --我依稀记得我以前也干过这些事情,晚上看了一下书: Apress.
986 0
|
关系型数据库 Oracle Linux
[20161230]rman checksyntax2.txt
[20161230]rman checksyntax2.txt --曾经写过一篇rman checksyntax的问题,这个问题存在10g: http://blog.
761 0
|
SQL Oracle 关系型数据库
[20161214]rman checksyntax.txt
[20161214]rman checksyntax.txt --rman在命令行使用参数checksyntax可以检查命令语法是否正确,而且并不会真正执行.但是昨天在恢复一个10g的数据库时遇到问题,做 --一个记录: 1.
946 0