ITPub博客

首页 > Linux操作系统 > Linux操作系统 > bbed实验一 changing data

bbed实验一 changing data

原创 Linux操作系统 作者:v_fantasy 时间:2009-04-03 19:49:41 0 删除 编辑

建立测试表

SQL> create table test(a number(10),b varchar2(100));

Table created.

SQL> insert into test values(1,'fantasy');

1 row created.

SQL> insert into test values(2,'daily');

1 row created.

SQL> insert into test values(3,'lovely');

1 row created.

SQL> commit;

查看所在文件
SQL> select file_name from dba_data_files where tablespace_name='USERS';

FILE_NAME
--------------------------------------------------------------------------------
/dev/rzz_01_lv

建立配置文件par.bbd

HHL-690-1:/oracle/bbed$more par.bbd
blocksize=8192
listfile=/oracle/bbed/filelist.txt
mode=edit

HHL-690-1:/oracle/bbed$more filelist.txt
2  /dev/rzz_01_lv
1  /dev/rzz_system_lv

我们先来看看表里的数据:

SQL> select * from test;

         A B
---------- ----------
         1 fantasy
         2 daily
         3 lovely

SQL> select rowid from test where b='fantasy';

ROWID
------------------
AAAMs7AAEAAAAA9AAA

SQL> select dbms_rowid.rowid_block_number('AAAMs7AAEAAAAA9AAA') from dual;

DBMS_ROWID.ROWID_BLOCK_NUMBER('AAAMS7AAEAAAAA9AAA')
---------------------------------------------------
                                                 61

SQL> select dbms_rowid.rowid_row_number('AAAMs7AAEAAAAA9AAA') from dual;

DBMS_ROWID.ROWID_ROW_NUMBER('AAAMS7AAEAAAAA9AAA')
-------------------------------------------------
                                                0

进入bbed

BBED> set file 2
        FILE#           2

BBED> set block 61
        BLOCK#          61

BBED> find /c fantasy  -----找到对应的offset
 File: /dev/rzz_01_lv (2)
 Block: 61               Offsets: 8181 to 8191           Dba:0x0080003d
------------------------------------------------------------------------
 66616e74 61737971 490605

 <32 bytes per line>

BBED> dump /v 8181 count 10
BBED-00202: invalid parameter (8181)


BBED> dump /v offset 8181 count 10
 File: /dev/rzz_01_lv (2)
 Block: 61      Offsets: 8181 to 8190  Dba:0x0080003d
-------------------------------------------------------
 66616e74 61737971 4906              l fantasyqI.

 <16 bytes per line>

BBED> modify /c ysatnaf offset 8181
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
 File: /dev/rzz_01_lv (2)
 Block: 61               Offsets: 8181 to 8190           Dba:0x0080003d
------------------------------------------------------------------------
 79736174 6e616671 4906

 <32 bytes per line>

BBED> dump /v
 File: /dev/rzz_01_lv (2)
 Block: 61      Offsets: 8181 to 8190  Dba:0x0080003d
-------------------------------------------------------
 79736174 6e616671 4906              l ysatnafqI.

 <16 bytes per line>

BBED>
BBED>
BBED> sum apply
Check value for File 2, Block 61:
current = 0x7001, required = 0x7001

修改完毕

我们现在来起库看看更改是否生效

SQL> startup
ORACLE instance started.

Total System Global Area 1073741824 bytes
Fixed Size                  2089504 bytes
Variable Size             184552928 bytes
Database Buffers          880803840 bytes
Redo Buffers                6295552 bytes
Database mounted.
Database opened.
SQL> conn zz/zz
Connected.
SQL> select * from test;

         A B
---------- ----------
         1 ysatnaf
         2 daily
         3 lovely

说明已经更改成功!

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16158219/viewspace-584616/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-10-07

  • 博文量
    98
  • 访问量
    179087