ORACLE SOS

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7382|回复: 2

copy一个块,如何在前台显示其中数据

[复制链接]

1

主题

1

帖子

5

积分

新手上路

Rank: 1

积分
5
发表于 2014-8-27 13:09:29 | 显示全部楼层 |阅读模式
飞哥,各位大侠,请帮忙看看
过程如下:
从同一个数据文件copy 块
BBED> copy dba 11,24 to dba 11,23
File: /app/oracle/oradata/test/demo01.dbf (11)
Block: 23               Offsets:    4 to   19           Dba:0x02c00017
------------------------------------------------------------------------
1800c002 2cd63700 00000204 62bf0000

<32 bytes per line>

BBED> p kcbh
struct kcbh, 20 bytes                       @0      
   ub1 type_kcbh                            @0        0x06
   ub1 frmt_kcbh                            @1        0xa2
   ub1 spare1_kcbh                          @2        0x00
   ub1 spare2_kcbh                          @3        0x00
   ub4 rdba_kcbh                            @4        0x02c00018
   ub4 bas_kcbh                             @8        0x0037d62c
   ub2 wrp_kcbh                             @12       0x0000
   ub1 seq_kcbh                             @14       0x02
   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)
   ub2 chkval_kcbh                          @16       0xbf62
   ub2 spare3_kcbh                          @18       0x0000

更改rdba
BBED> modify /x 17 offset 4
File: /app/oracle/oradata/test/demo01.dbf (11)
Block: 23               Offsets:    4 to   19           Dba:0x02c00017
------------------------------------------------------------------------
1700c002 2cd63700 00000204 62bf0000

<32 bytes per line>

BBED> p kcbh
struct kcbh, 20 bytes                       @0      
   ub1 type_kcbh                            @0        0x06
   ub1 frmt_kcbh                            @1        0xa2
   ub1 spare1_kcbh                          @2        0x00
   ub1 spare2_kcbh                          @3        0x00
   ub4 rdba_kcbh                            @4        0x02c00017
   ub4 bas_kcbh                             @8        0x0037d62c
   ub2 wrp_kcbh                             @12       0x0000
   ub1 seq_kcbh                             @14       0x02
   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)
   ub2 chkval_kcbh                          @16       0xbf62
   ub2 spare3_kcbh                          @18       0x0000

BBED> sum apply
Check value for File 11, Block 23:
current = 0xbf6d, required = 0xbf6d

BBED> verify
DBVERIFY - Verification starting
FILE = /app/oracle/oradata/test/demo01.dbf
BLOCK = 23


DBVERIFY - Verification complete

Total Blocks Examined         : 1
Total Blocks Processed (Data) : 1
Total Blocks Failing   (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing   (Index): 0
Total Blocks Empty            : 0
Total Blocks Marked Corrupt   : 0
Total Blocks Influx           : 0
Message 531 not found;  product=RDBMS; facility=BBED


BBED>
BBED>
BBED> p kdbr
sb2 kdbr[0]                                 @142      7988

BBED> p *kdbr[0]
rowdata[0]
----------
ub1 rowdata[0]                              @8112     0x2c

BBED> d /v
File: /app/oracle/oradata/test/demo01.dbf (11)
Block: 23      Offsets: 8112 to 8191  Dba:0x02c00017
-------------------------------------------------------
2c000e03 53595304 55455424 ff02c10e l ,...SYS.UET$....
02c10905 5441424c 45077871 08180c26 l ....TABLE.xq...&
24077871 08180c26 24133230 31332d30 l $.xq...&$.2013-0
382d3234 3a31313a 33373a33 35055641 l 8-24:11:37:35.VA
4c494401 4e014e01 4e02c102 02062cd6 l LID.N.N.N.....,.


BBED> x /rcccnncttcccccnc
rowdata[0]                                  @8112   
----------
flag@8112: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8113: 0x00
cols@8114:   14

col    0[3] @8115: SYS
col    1[4] @8119: UET$
col    2[0] @8124: *NULL*
col    3[2] @8125: 13
col    4[2] @8128: 8
col    5[5] @8131: TABLE
col    6[7] @8137: 24-AUG-13
col    7[7] @8145: 24-AUG-13
col   8[19] @8153: 2013-08-24:11:37:35
col    9[5] @8173: VALID
col   10[1] @8179: N
col   11[1] @8181: N
col   12[1] @8183: N
col   13[2] @8185: 1

到这里为止,如何让前台可以看到这里的数据,我刷新过buffer_cache和重启过数据库,前台依然看不到数据
谢谢


回复

使用道具 举报

0

主题

6

帖子

11

积分

新手上路

Rank: 1

积分
11
发表于 2014-9-9 14:04:53 | 显示全部楼层
学习了,, 谢谢飞总
回复 支持 反对

使用道具 举报

95

主题

266

帖子

1719

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1719
发表于 2014-9-14 22:43:30 | 显示全部楼层
我做了测试,结果是ok的,请看如下过程

  1. SQL> conn chf/xifenfei
  2. Connected.
  3. SQL> create table t_xifenfei as select * from dba_objects;

  4. Table created.


  5. SQL> select EXTENT_ID,FILE_ID,BLOCK_ID,BLOCKS from dba_extents where segment_name='T_XIFENFEI' AND OWNER='CHF';

  6. EXTENT_ID    FILE_ID   BLOCK_ID     BLOCKS
  7. ---------- ---------- ---------- ----------
  8.          0          4        176          8
  9.          1          4        184          8
  10.          2          4        192          8
  11.          3          4        200          8
  12.          4          4        208          8
  13.          5          4        216          8
  14.          6          4        224          8
  15.          7          4        232          8
  16.          8          4        240          8
  17.          9          4        248          8
  18.         10          4        256          8

  19. EXTENT_ID    FILE_ID   BLOCK_ID     BLOCKS
  20. ---------- ---------- ---------- ----------
  21.         11          4        264          8
  22.         12          4        272          8
  23.         13          4        280          8
  24.         14          4        288          8
  25.         15          4        296          8
  26.         16          4        384        128
  27.         17          4        512        128
  28.         18          4        640        128
  29.         19          4        768        128
  30.         20          4        896        128
  31.         21          4       1024        128

  32. EXTENT_ID    FILE_ID   BLOCK_ID     BLOCKS
  33. ---------- ---------- ---------- ----------
  34.         22          4       1152        128
  35.         23          4       1280        128
  36.         24          4       1408        128

  37. 25 rows selected.

  38. SQL>  select * from (select distinct dbms_rowid.rowid_relative_fno(rowid),
  39.   2  dbms_rowid.rowid_block_number(rowid) from t_xifenfei ORDER BY 2 )where rownum<5 ;

  40. DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID) DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
  41. ------------------------------------ ------------------------------------
  42.                                    4                                  179
  43.                                    4                                  180
  44.                                    4                                  181
  45.                                    4                                  182



  46. SQL> select object_id from t_xifenfei where  dbms_rowid.rowid_relative_fno(rowid)=4 and dbms_rowid.rowid_block_number(rowid)=180;

  47. OBJECT_ID
  48. ----------
  49.         81
  50.         82
  51.         83
  52.         84
  53.         85
  54.         86
  55.         87
  56.         88
  57.         89
  58.         90
  59.         91

  60. OBJECT_ID
  61. ----------
  62.         92
  63.         93
  64.         94
  65.         95
  66.         96
  67.         97
  68.         98
  69.         99
  70.        100
  71.        101
  72.        102

  73. OBJECT_ID
  74. ----------
  75.        103
  76.        104
  77.        105
  78.        106
  79.        107
  80.        108
  81.        109
  82.        110
  83.        111
  84.        112
  85.        113

  86. OBJECT_ID
  87. ----------
  88.        114
  89.        115
  90.        116
  91.        117
  92.        118
  93.        119
  94.        120
  95.        121
  96.        122
  97.        123
  98.        124

  99. OBJECT_ID
  100. ----------
  101.        125
  102.        126
  103.        127
  104.        129
  105.        128
  106.        130
  107.        131
  108.        132
  109.        133
  110.        134
  111.        135

  112. OBJECT_ID
  113. ----------
  114.        137
  115.        136
  116.        138
  117.        139
  118.        140
  119.        141
  120.        142
  121.        143
  122.        144
  123.        145
  124.        146

  125. OBJECT_ID
  126. ----------
  127.        147
  128.        148
  129.        149
  130.        150
  131.        151
  132.        153
  133.        152
  134.        154
  135.        155
  136.        156

  137. 76 rows selected.

  138. SQL> select object_id from t_xifenfei where  dbms_rowid.rowid_relative_fno(rowid)=4 and dbms_rowid.rowid_block_number(rowid)=181;

  139. OBJECT_ID
  140. ----------
  141.        157
  142.        158
  143.        159
  144.        160
  145.        161
  146.        162
  147.        163
  148.        164
  149.        165
  150.        166
  151.        167

  152. OBJECT_ID
  153. ----------
  154.        168
  155.        169
  156.        170
  157.        171
  158.        172
  159.        173
  160.        174
  161.        175
  162.        176
  163.        177
  164.        178

  165. OBJECT_ID
  166. ----------
  167.        179
  168.        180
  169.        181
  170.        182
  171.        183
  172.        184
  173.        185
  174.        186
  175.        187
  176.        188
  177.        189

  178. OBJECT_ID
  179. ----------
  180.        190
  181.        191
  182.        192
  183.        193
  184.        194
  185.        195
  186.        196
  187.        197
  188.        198
  189.        199
  190.        200

  191. OBJECT_ID
  192. ----------
  193.        201
  194.        202
  195.        203
  196.        204
  197.        205
  198.        206
  199.        208
  200.        207
  201.        209
  202.        210
  203.        211

  204. OBJECT_ID
  205. ----------
  206.        212
  207.        213
  208.        214
  209.        215
  210.        216
  211.        217
  212.        218
  213.        219
  214.        220
  215.        221
  216.        222

  217. OBJECT_ID
  218. ----------
  219.        223
  220.        224
  221.        225
  222.        226
  223.        227
  224.        228
  225.        229
  226.        230
  227.        231

  228. 75 rows selected.

  229. SQL> select name from v$datafile where file#=4;

  230. NAME
  231. --------------------------------------------------------------------------------
  232. /u01/app/oracle/oradata/ORCL/users01.dbf



  233. [oracle@oel6 ~]$ bbed filename='/u01/app/oracle/oradata/ORCL/users01.dbf' mode=edit blocksize=8192
  234. Password:

  235. BBED: Release 2.0.0.0.0 - Limited Production on Wed Aug 6 21:17:11 2014

  236. Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

  237. ************* !!! For Oracle Internal Use only !!! ***************

  238. BBED> show all
  239.         FILE#           0
  240.         BLOCK#          1
  241.         OFFSET          0
  242.         DBA             0x00000000 (0 0,1)
  243.         FILENAME        /u01/app/oracle/oradata/ORCL/users01.dbf
  244.         BIFILE          bifile.bbd
  245.         LISTFILE      
  246.         BLOCKSIZE       8192
  247.         MODE            Edit
  248.         EDIT            Unrecoverable
  249.         IBASE           Dec
  250.         OBASE           Dec
  251.         WIDTH           80
  252.         COUNT           512
  253.         LOGFILE         log.bbd
  254.         SPOOL           No

  255. BBED> map
  256. File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
  257. Block: 180                                   Dba:0x00000000
  258. ------------------------------------------------------------
  259. KTB Data Block (Table/Cluster)

  260. struct kcbh, 20 bytes                      @0      

  261. struct ktbbh, 96 bytes                     @20      

  262. struct kdbh, 14 bytes                      @124     

  263. struct kdbt[1], 4 bytes                    @138     

  264. sb2 kdbr[76]                               @142     

  265. ub1 freespace[856]                         @294     

  266. ub1 rowdata[7038]                          @1150   

  267. ub4 tailchk                                @8188   


  268. BBED> p kcbh
  269. struct kcbh, 20 bytes                       @0      
  270.    ub1 type_kcbh                            @0        0x06
  271.    ub1 frmt_kcbh                            @1        0xa2
  272.    ub1 spare1_kcbh                          @2        0x00
  273.    ub1 spare2_kcbh                          @3        0x00
  274.    ub4 rdba_kcbh                            @4        0x010000b4
  275.    ub4 bas_kcbh                             @8        0x000b258a
  276.    ub2 wrp_kcbh                             @12       0x0000
  277.    ub1 seq_kcbh                             @14       0x02
  278.    ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)
  279.    ub2 chkval_kcbh                          @16       0x0eb6
  280.    ub2 spare3_kcbh                          @18       0x0000

  281. BBED> p kcbh block 181           
  282. struct kcbh, 20 bytes                       @0      
  283.    ub1 type_kcbh                            @0        0x06
  284.    ub1 frmt_kcbh                            @1        0xa2
  285.    ub1 spare1_kcbh                          @2        0x00
  286.    ub1 spare2_kcbh                          @3        0x00
  287.    ub4 rdba_kcbh                            @4        0x010000b5
  288.    ub4 bas_kcbh                             @8        0x000b258a
  289.    ub2 wrp_kcbh                             @12       0x0000
  290.    ub1 seq_kcbh                             @14       0x02
  291.    ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)
  292.    ub2 chkval_kcbh                          @16       0xa1c5
  293.    ub2 spare3_kcbh                          @18       0x0000


  294. BBED> copy block 180 to block 181
  295. File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
  296. Block: 181              Offsets:    0 to  511           Dba:0x00000000
  297. ------------------------------------------------------------------------
  298. 06a20000 b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00
  299. 00000000 03003200 b0000001 ffff0000 00000000 00000000 00000000 00800000
  300. 84250b00 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  301. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00014c00
  302. ffffaa00 02045803 58030000 4c00221f c21e661e 0e1eb01d 521df81c 9e1c421c
  303. ea1b901b 361be11a 8c1a361a da198019 2419c818 73181918 b9176017 0717ae16
  304. 5416f815 a2154915 f0149614 3914dc13 7f131f13 c8126e12 1412ba11 61110511
  305. a9104f10 f20f900f 370fdc0e 710e070e a60d430d df0c850c 2a0ccf0b 640bfa0a
  306. 9d0a400a e6098509 2e09d408 79081e08 c3076607 0907a206 3806e005 75050b05
  307. b0045a04 02040000 00000000 00000000 00000000 00000000 00000000 00000000
  308. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  309. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  310. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  311. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  312. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  313. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

  314. <32 bytes per line>

  315. BBED> p kcbh block 181
  316. struct kcbh, 20 bytes                       @0      
  317.    ub1 type_kcbh                            @0        0x06
  318.    ub1 frmt_kcbh                            @1        0xa2
  319.    ub1 spare1_kcbh                          @2        0x00
  320.    ub1 spare2_kcbh                          @3        0x00
  321.    ub4 rdba_kcbh                            @4        0x010000b4
  322.    ub4 bas_kcbh                             @8        0x000b258a
  323.    ub2 wrp_kcbh                             @12       0x0000
  324.    ub1 seq_kcbh                             @14       0x02
  325.    ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)
  326.    ub2 chkval_kcbh                          @16       0x0eb6
  327.    ub2 spare3_kcbh                          @18       0x0000

  328. BBED> p rdba_kcbh
  329. ub4 rdba_kcbh                               @4        0x010000b4

  330. BBED> d
  331. File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
  332. Block: 181              Offsets:    4 to  515           Dba:0x00000000
  333. ------------------------------------------------------------------------
  334. b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000
  335. 03003200 b0000001 ffff0000 00000000 00000000 00000000 00800000 84250b00
  336. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  337. 00000000 00000000 00000000 00000000 00000000 00000000 00014c00 ffffaa00
  338. 02045803 58030000 4c00221f c21e661e 0e1eb01d 521df81c 9e1c421c ea1b901b
  339. 361be11a 8c1a361a da198019 2419c818 73181918 b9176017 0717ae16 5416f815
  340. a2154915 f0149614 3914dc13 7f131f13 c8126e12 1412ba11 61110511 a9104f10
  341. f20f900f 370fdc0e 710e070e a60d430d df0c850c 2a0ccf0b 640bfa0a 9d0a400a
  342. e6098509 2e09d408 79081e08 c3076607 0907a206 3806e005 75050b05 b0045a04
  343. 02040000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  344. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  345. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  346. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  347. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  348. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  349. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

  350. <32 bytes per line>

  351. BBED> set count 32
  352.         COUNT           32

  353. BBED> d
  354. File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
  355. Block: 181              Offsets:    4 to   35           Dba:0x00000000
  356. ------------------------------------------------------------------------
  357. b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000

  358. <32 bytes per line>

  359. BBED> m /x b5
  360. File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
  361. Block: 181              Offsets:    4 to   35           Dba:0x00000000
  362. ------------------------------------------------------------------------
  363. b5000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000

  364. <32 bytes per line>

  365. BBED> sum apply
  366. Check value for File 0, Block 181:
  367. current = 0x0eb7, required = 0x0eb7

  368. BBED> p kcbh block 181
  369. struct kcbh, 20 bytes                       @0      
  370.    ub1 type_kcbh                            @0        0x06
  371.    ub1 frmt_kcbh                            @1        0xa2
  372.    ub1 spare1_kcbh                          @2        0x00
  373.    ub1 spare2_kcbh                          @3        0x00
  374.    ub4 rdba_kcbh                            @4        0x010000b5
  375.    ub4 bas_kcbh                             @8        0x000b258a
  376.    ub2 wrp_kcbh                             @12       0x0000
  377.    ub1 seq_kcbh                             @14       0x02
  378.    ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)
  379.    ub2 chkval_kcbh                          @16       0x0eb7
  380.    ub2 spare3_kcbh                          @18       0x0000


  381. SQL>  select object_id from t_xifenfei where  dbms_rowid.rowid_relative_fno(rowid)=4 and dbms_rowid.rowid_block_number(rowid)=181;

  382. OBJECT_ID
  383. ----------
  384.         81
  385.         82
  386.         83
  387.         84
  388.         85
  389.         86
  390.         87
  391.         88
  392.         89
  393.         90
  394.         91

  395. OBJECT_ID
  396. ----------
  397.         92
  398.         93
  399.         94
  400.         95
  401.         96
  402.         97
  403.         98
  404.         99
  405.        100
  406.        101
  407.        102

  408. OBJECT_ID
  409. ----------
  410.        103
  411.        104
  412.        105
  413.        106
  414.        107
  415.        108
  416.        109
  417.        110
  418.        111
  419.        112
  420.        113

  421. OBJECT_ID
  422. ----------
  423.        114
  424.        115
  425.        116
  426.        117
  427.        118
  428.        119
  429.        120
  430.        121
  431.        122
  432.        123
  433.        124

  434. OBJECT_ID
  435. ----------
  436.        125
  437.        126
  438.        127
  439.        129
  440.        128
  441.        130
  442.        131
  443.        132
  444.        133
  445.        134
  446.        135

  447. OBJECT_ID
  448. ----------
  449.        137
  450.        136
  451.        138
  452.        139
  453.        140
  454.        141
  455.        142
  456.        143
  457.        144
  458.        145
  459.        146

  460. OBJECT_ID
  461. ----------
  462.        147
  463.        148
  464.        149
  465.        150
  466.        151
  467.        153
  468.        152
  469.        154
  470.        155
  471.        156

  472. 76 rows selected.
复制代码

Q Q:107644445
Tel:13429648788
Email:dba@xifenfei.com
个人Blog(惜分飞)
提供专业ORACLE技术支持(数据恢复,安装实施,升级迁移,备份容灾,故障诊断,系统优化等)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|ORACLE SOS 技术论坛

GMT+8, 2024-5-8 10:58 , Processed in 0.026429 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表