本篇內(nèi)容介紹了“Oracle BBED怎么修改數(shù)據(jù)塊中的數(shù)據(jù)”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠?qū)W有所成!
成都創(chuàng)新互聯(lián)公司專注于企業(yè)成都全網(wǎng)營銷、網(wǎng)站重做改版、賽罕網(wǎng)站定制設(shè)計、自適應(yīng)品牌網(wǎng)站建設(shè)、H5建站、商城開發(fā)、集團公司官網(wǎng)建設(shè)、外貿(mào)網(wǎng)站制作、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計等建站業(yè)務(wù),價格優(yōu)惠性價比高,為賽罕等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。
BBED修改數(shù)據(jù):
建立測試數(shù)據(jù):
SQL> create table dbhang (id number,name varchar2(20));
Table created.
SQL> insert into dbhang values(1,’baoyuhang’);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from dbhang;
ID NAME
1 baoyuhang
查看文件號,塊號,行號:
select
rowid,
dbms_rowid.rowid_relative_fno(rowid)rel_fno,
dbms_rowid.rowid_block_number(rowid)blockno,
dbms_rowid.rowid_row_number(rowid) rowno
from dbhang;
ROWID REL_FNO BLOCKNO ROWNO
AAAVoxAABAAAW8BAAA 1 93953 0
查詢數(shù)據(jù)文件:
SQL> select file# || ‘ ‘ ||name || ‘’ || bytes from v$datafile;
FILE#||’’||NAME||’’||BYTES
1 /oracle/app/oradata/prod/system01.dbf786432000
2 /oracle/app/oradata/prod/sysaux01.dbf545259520
3 /oracle/app/oradata/prod/undotbs01.dbf94371840
4 /oracle/app/oradata/prod/users01.dbf5242880
5 /oracle/app/oradata/prod/example01.dbf328335360
6 /oracle/app/oradata/prod/dbhang01.dbf52428800
7 /oracle/app/oradata/prod/dbhang02.dbf52428800
將以上查詢的信息保存在文本中:
[oracle
@server1 ~]$ cat datafile.txt
1 /oracle/app/oradata/prod/system01.dbf 786432000
2 /oracle/app/oradata/prod/sysaux01.dbf 545259520
3 /oracle/app/oradata/prod/undotbs01.dbf 94371840
4 /oracle/app/oradata/prod/users01.dbf 5242880
5 /oracle/app/oradata/prod/example01.dbf 328335360
6 /oracle/app/oradata/prod/dbhang01.dbf 52428800
7 /oracle/app/oradata/prod/dbhang02.dbf 52428800
關(guān)閉數(shù)據(jù)庫:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
創(chuàng)建BBED參數(shù)文件:
[oracle
@server1 ~]$ cat bbed.par
blocksize=8192
listfile=/home/oracle/datafile.txt //指定文本文件
mode=edit //編輯模式
現(xiàn)將數(shù)據(jù)baoyuhang修改為bbbyuhang
連接BBED,進行數(shù)據(jù)定位:
[oracle
@server1 ~]$ bbed parfile=/home/oracle/bbed.par
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Thu Jul 30 05:59:45 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
*!!! For Oracle Internal Use only !!! *
BBED>
指定1號文件93953號塊:
BBED> set dba 1,93953 offset 0
DBA 0x00416f01 (4288257 1,93953)
OFFSET 0
定位數(shù)據(jù):(確定數(shù)據(jù)在block中的偏移量)
BBED> find /c baoyuhang
File: /oracle/app/oradata/prod/system01.dbf (1)
Block: 93953 Offsets: 8179 to 8191 Dba:0x00416f01
62616f79 7568616e 6704066c 38
dump查看一下offset 8179信息:
BBED> dump /v dba 1,93953 offset 8179 count 128
File: /oracle/app/oradata/prod/system01.dbf (1)
Block: 93953 Offsets: 8179 to 8191 Dba:0x00416f01
62616f79 7568616e 6704066c 38 l baoyuhang..l8
Offsets: 8179 to 8191 代表這一行的地址。
也是說baoyuhang屬于8179-8191
b:8179
a:8180
o:8181
修改 block將bao替換為bbb:
BBED>
modify /c bbb dba 1,93953 offset 8179
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oracle/app/oradata/prod/system01.dbf (1)
Block: 93953 Offsets: 8179 to 8191 Dba:0x00416f01
62626279 7568616e 670106ba 3c
再次查看修改后的數(shù)據(jù):
BBED> dump /v dba 1,93953 offset 8179 count 128
File: /oracle/app/oradata/prod/system01.dbf (1)
Block: 93953 Offsets: 8179 to 8191 Dba:0x00416f01
62626279 7568616e 6704066c 38 l bbbyuhang..l8
應(yīng)用變更:
BBED> sum dba 1,93953 apply
Check value for File 1, Block 93953:
current = 0x29a2, required = 0x29a2
回到sqlplus查詢修改后的數(shù)據(jù)
SQL> startup;
ORACLE instance started.
Total System Global Area 830930944 bytes
Fixed Size 2257800 bytes
Variable Size 541068408 bytes
Database Buffers 281018368 bytes
Redo Buffers 6586368 bytes
Database mounted.
Database opened.
SQL> select * from dbhang;
ID NAME
1 bbbyuhang
修改完畢.
BBED的安裝: http://blog.itpub.net/69975956/viewspace-2707944/
“Oracle BBED怎么修改數(shù)據(jù)塊中的數(shù)據(jù)”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!