copy一个块,如何在前台显示其中数据
飞哥,各位大侠,请帮忙看看过程如下:
从同一个数据文件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 @142 7988
BBED> p *kdbr
rowdata
----------
ub1 rowdata @8112 0x2c
BBED> d /v
File: /app/oracle/oradata/test/demo01.dbf (11)
Block: 23 Offsets: 8112 to 8191Dba: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 @8112
----------
flag@8112: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8113: 0x00
cols@8114: 14
col 0 @8115: SYS
col 1 @8119: UET$
col 2 @8124: *NULL*
col 3 @8125: 13
col 4 @8128: 8
col 5 @8131: TABLE
col 6 @8137: 24-AUG-13
col 7 @8145: 24-AUG-13
col 8 @8153: 2013-08-24:11:37:35
col 9 @8173: VALID
col 10 @8179: N
col 11 @8181: N
col 12 @8183: N
col 13 @8185: 1
到这里为止,如何让前台可以看到这里的数据,我刷新过buffer_cache和重启过数据库,前台依然看不到数据
谢谢
学习了,, 谢谢飞总 我做了测试,结果是ok的,请看如下过程
SQL> conn chf/xifenfei
Connected.
SQL> create table t_xifenfei as select * from dba_objects;
Table created.
SQL> select EXTENT_ID,FILE_ID,BLOCK_ID,BLOCKS from dba_extents where segment_name='T_XIFENFEI' AND OWNER='CHF';
EXTENT_ID FILE_ID BLOCK_ID BLOCKS
---------- ---------- ---------- ----------
0 4 176 8
1 4 184 8
2 4 192 8
3 4 200 8
4 4 208 8
5 4 216 8
6 4 224 8
7 4 232 8
8 4 240 8
9 4 248 8
10 4 256 8
EXTENT_ID FILE_ID BLOCK_ID BLOCKS
---------- ---------- ---------- ----------
11 4 264 8
12 4 272 8
13 4 280 8
14 4 288 8
15 4 296 8
16 4 384 128
17 4 512 128
18 4 640 128
19 4 768 128
20 4 896 128
21 4 1024 128
EXTENT_ID FILE_ID BLOCK_ID BLOCKS
---------- ---------- ---------- ----------
22 4 1152 128
23 4 1280 128
24 4 1408 128
25 rows selected.
SQL>select * from (select distinct dbms_rowid.rowid_relative_fno(rowid),
2dbms_rowid.rowid_block_number(rowid) from t_xifenfei ORDER BY 2 )where rownum<5 ;
DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID) DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
------------------------------------ ------------------------------------
4 179
4 180
4 181
4 182
SQL> select object_id from t_xifenfei wheredbms_rowid.rowid_relative_fno(rowid)=4 and dbms_rowid.rowid_block_number(rowid)=180;
OBJECT_ID
----------
81
82
83
84
85
86
87
88
89
90
91
OBJECT_ID
----------
92
93
94
95
96
97
98
99
100
101
102
OBJECT_ID
----------
103
104
105
106
107
108
109
110
111
112
113
OBJECT_ID
----------
114
115
116
117
118
119
120
121
122
123
124
OBJECT_ID
----------
125
126
127
129
128
130
131
132
133
134
135
OBJECT_ID
----------
137
136
138
139
140
141
142
143
144
145
146
OBJECT_ID
----------
147
148
149
150
151
153
152
154
155
156
76 rows selected.
SQL> select object_id from t_xifenfei wheredbms_rowid.rowid_relative_fno(rowid)=4 and dbms_rowid.rowid_block_number(rowid)=181;
OBJECT_ID
----------
157
158
159
160
161
162
163
164
165
166
167
OBJECT_ID
----------
168
169
170
171
172
173
174
175
176
177
178
OBJECT_ID
----------
179
180
181
182
183
184
185
186
187
188
189
OBJECT_ID
----------
190
191
192
193
194
195
196
197
198
199
200
OBJECT_ID
----------
201
202
203
204
205
206
208
207
209
210
211
OBJECT_ID
----------
212
213
214
215
216
217
218
219
220
221
222
OBJECT_ID
----------
223
224
225
226
227
228
229
230
231
75 rows selected.
SQL> select name from v$datafile where file#=4;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ORCL/users01.dbf
$ bbed filename='/u01/app/oracle/oradata/ORCL/users01.dbf' mode=edit blocksize=8192
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Wed Aug 6 21:17:11 2014
Copyright (c) 1982, 2013, Oracle and/or its affiliates.All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> show all
FILE# 0
BLOCK# 1
OFFSET 0
DBA 0x00000000 (0 0,1)
FILENAME /u01/app/oracle/oradata/ORCL/users01.dbf
BIFILE bifile.bbd
LISTFILE
BLOCKSIZE 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No
BBED> map
File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
Block: 180 Dba:0x00000000
------------------------------------------------------------
KTB Data Block (Table/Cluster)
struct kcbh, 20 bytes @0
struct ktbbh, 96 bytes @20
struct kdbh, 14 bytes @124
struct kdbt, 4 bytes @138
sb2 kdbr @142
ub1 freespace @294
ub1 rowdata @1150
ub4 tailchk @8188
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 0x010000b4
ub4 bas_kcbh @8 0x000b258a
ub2 wrp_kcbh @12 0x0000
ub1 seq_kcbh @14 0x02
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0x0eb6
ub2 spare3_kcbh @18 0x0000
BBED> p kcbh block 181
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 0x010000b5
ub4 bas_kcbh @8 0x000b258a
ub2 wrp_kcbh @12 0x0000
ub1 seq_kcbh @14 0x02
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0xa1c5
ub2 spare3_kcbh @18 0x0000
BBED> copy block 180 to block 181
File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
Block: 181 Offsets: 0 to511 Dba:0x00000000
------------------------------------------------------------------------
06a20000 b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00
00000000 03003200 b0000001 ffff0000 00000000 00000000 00000000 00800000
84250b00 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00014c00
ffffaa00 02045803 58030000 4c00221f c21e661e 0e1eb01d 521df81c 9e1c421c
ea1b901b 361be11a 8c1a361a da198019 2419c818 73181918 b9176017 0717ae16
5416f815 a2154915 f0149614 3914dc13 7f131f13 c8126e12 1412ba11 61110511
a9104f10 f20f900f 370fdc0e 710e070e a60d430d df0c850c 2a0ccf0b 640bfa0a
9d0a400a e6098509 2e09d408 79081e08 c3076607 0907a206 3806e005 75050b05
b0045a04 02040000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<32 bytes per line>
BBED> p kcbh block 181
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 0x010000b4
ub4 bas_kcbh @8 0x000b258a
ub2 wrp_kcbh @12 0x0000
ub1 seq_kcbh @14 0x02
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0x0eb6
ub2 spare3_kcbh @18 0x0000
BBED> p rdba_kcbh
ub4 rdba_kcbh @4 0x010000b4
BBED> d
File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
Block: 181 Offsets: 4 to515 Dba:0x00000000
------------------------------------------------------------------------
b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000
03003200 b0000001 ffff0000 00000000 00000000 00000000 00800000 84250b00
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00014c00 ffffaa00
02045803 58030000 4c00221f c21e661e 0e1eb01d 521df81c 9e1c421c ea1b901b
361be11a 8c1a361a da198019 2419c818 73181918 b9176017 0717ae16 5416f815
a2154915 f0149614 3914dc13 7f131f13 c8126e12 1412ba11 61110511 a9104f10
f20f900f 370fdc0e 710e070e a60d430d df0c850c 2a0ccf0b 640bfa0a 9d0a400a
e6098509 2e09d408 79081e08 c3076607 0907a206 3806e005 75050b05 b0045a04
02040000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<32 bytes per line>
BBED> set count 32
COUNT 32
BBED> d
File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
Block: 181 Offsets: 4 to 35 Dba:0x00000000
------------------------------------------------------------------------
b4000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000
<32 bytes per line>
BBED> m /x b5
File: /u01/app/oracle/oradata/ORCL/users01.dbf (0)
Block: 181 Offsets: 4 to 35 Dba:0x00000000
------------------------------------------------------------------------
b5000001 8a250b00 00000204 b60e0000 01000000 252d0100 84250b00 00000000
<32 bytes per line>
BBED> sum apply
Check value for File 0, Block 181:
current = 0x0eb7, required = 0x0eb7
BBED> p kcbh block 181
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 0x010000b5
ub4 bas_kcbh @8 0x000b258a
ub2 wrp_kcbh @12 0x0000
ub1 seq_kcbh @14 0x02
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0x0eb7
ub2 spare3_kcbh @18 0x0000
SQL>select object_id from t_xifenfei wheredbms_rowid.rowid_relative_fno(rowid)=4 and dbms_rowid.rowid_block_number(rowid)=181;
OBJECT_ID
----------
81
82
83
84
85
86
87
88
89
90
91
OBJECT_ID
----------
92
93
94
95
96
97
98
99
100
101
102
OBJECT_ID
----------
103
104
105
106
107
108
109
110
111
112
113
OBJECT_ID
----------
114
115
116
117
118
119
120
121
122
123
124
OBJECT_ID
----------
125
126
127
129
128
130
131
132
133
134
135
OBJECT_ID
----------
137
136
138
139
140
141
142
143
144
145
146
OBJECT_ID
----------
147
148
149
150
151
153
152
154
155
156
76 rows selected.
页:
[1]