[20160529]windows下使用bbed.txt

lfree發表於2016-05-30

[20160529]windows下使用bbed.txt

--windows下 oracle 9.2.0.8 自帶bbed,10g以後的版本就沒有帶.可以從9i for windows下打包bbed,在10,11g for windows下使用.
--我們生產系統目前還存一套oracle 9.2.0.8 for windows的系統,很久以前我就做好了,好像我參考了惜分飛的連結,我自己很少
--使用,最近拿來用用看:

1.整理需要的檔案:
D:\tools\bbed>ls -lR
total 24603
-rw-rw-rw-   1 user     group      651536 Jun 28  2006 ORACORE9.DLL
-rw-rw-rw-   1 user     group       24848 Jul 29  2006 ORANCDS9.DLL
-rw-rw-rw-   1 user     group       33040 Jul 29  2006 ORANGSS9.DLL
-rw-rw-rw-   1 user     group      213264 Jul 29  2006 ORANK59.DLL
-rw-rw-rw-   1 user     group      499984 Jun 28  2006 ORANLS9.DLL
-rw-rw-rw-   1 user     group       28944 Jul 29  2006 ORANNZMCS9.DLL
-rw-rw-rw-   1 user     group       45328 Jul 29  2006 ORANRAD9.DLL
-rw-rw-rw-   1 user     group       53520 Jul 29  2006 ORANTCPS9.DLL
-rw-rw-rw-   1 user     group       61712 Jul 29  2006 ORAPLC9.DLL
-rw-rw-rw-   1 user     group      909584 Jul 29  2006 ORAPLP9.DLL
-rw-rw-rw-   1 user     group     3281168 Jul 29  2006 ORAPLS9.DLL
-rw-rw-rw-   1 user     group       57784 Jul 29  2006 ORAPRTOP9.DLL
-rw-rw-rw-   1 user     group       28944 Apr 26  2002 ORASLAX9.DLL
-rw-rw-rw-   1 user     group       69904 Jun 28  2006 ORASNLS9.DLL
-rw-rw-rw-   1 user     group      483600 Jun 28  2006 ORASQL9.DLL
-rw-rw-rw-   1 user     group       69904 Jun 28  2006 ORAUNLS9.DLL
-rw-rw-rw-   1 user     group      520464 Jun 27  2006 ORAXML9.DLL
-rw-rw-rw-   1 user     group       41232 Jun 27  2006 ORAXMLG9.DLL
-rw-rw-rw-   1 user     group      172304 Jun 27  2006 ORAXSD9.DLL
-rwxrwxrwx   1 user     group      147728 Jul 29  2006 bbed.exe
-rw-rw-rw-   1 user     group          84 Nov 13  2012 bbed.par
-rwxrwxrwx   1 user     group          39 May 28 20:25 bbed1.bat
-rw-rw-rw-   1 user     group       18432 May 28 22:09 bifile.bbd
-rw-rw-rw-   1 user     group          30 May 28 20:23 cmd.par
drwxrwxrwx   1 user     group           0 Oct 22  2013 dbms
-rw-rw-rw-   1 user     group         546 May 28 20:22 filelist.txt
-rw-rw-rw-   1 user     group       20752 Jun 28  2006 heteroxa9.dll
-rw-rw-rw-   1 user     group       49152 Mar  4  2005 kpp95rdr.dll
-rw-rw-rw-   1 user     group       45056 Mar  4  2005 kpp97rdr.dll
-rw-rw-rw-   1 user     group        9388 May 28 22:38 log.bbd
-rw-rw-rw-   1 user     group      229648 Jul 29  2006 njssl9.dll
-rw-rw-rw-   1 user     group       61712 Jun 28  2006 ocijdbc9.dll
-rw-rw-rw-   1 user     group      733184 Apr 26  2002 oip9.dll
-rw-rw-rw-   1 user     group     1589520 Jul 29  2006 oraclient9.dll
-rw-rw-rw-   1 user     group      602384 Jul 29  2006 oracommon9.dll
-rw-rw-rw-   1 user     group     1736976 Jun 27  2006 oractxx9.dll
-rw-rw-rw-   1 user     group     2691344 Jul 29  2006 orageneric9.dll
-rw-rw-rw-   1 user     group       24576 Jul 29  2006 oraimr9.dll
-rw-rw-rw-   1 user     group     3014656 Jul 29  2006 orajox9.dll
-rw-rw-rw-   1 user     group      155920 Jun 28  2006 oraldapclnt9.dll
-rw-rw-rw-   1 user     group       24848 Jun 28  2006 oraldapjclnt9.dll
-rw-rw-rw-   1 user     group      741648 Jul 29  2006 oran9.dll
-rw-rw-rw-   1 user     group       41232 Jul 29  2006 oranad9.dll
-rw-rw-rw-   1 user     group       33040 Jul 29  2006 oranbeq9.dll
-rw-rw-rw-   1 user     group       98576 Jul 29  2006 orancrypt9.dll
-rw-rw-rw-   1 user     group       24848 Jul 29  2006 oranhost9.dll
-rw-rw-rw-   1 user     group       33040 Jul 29  2006 oranipc9.dll
-rw-rw-rw-   1 user     group      176400 Jul 29  2006 oranjni9.dll
-rw-rw-rw-   1 user     group      180496 Jul 29  2006 oranl9.dll
-rw-rw-rw-   1 user     group       74000 Jul 29  2006 oranldap9.dll
-rw-rw-rw-   1 user     group       28944 Jul 29  2006 oranldapj9.dll
-rw-rw-rw-   1 user     group       28944 Jun 27  2006 oranms.dll
-rw-rw-rw-   1 user     group       69904 Jun 27  2006 oranmsp.dll
-rw-rw-rw-   1 user     group       33040 Jul 29  2006 orannmp9.dll
-rw-rw-rw-   1 user     group       53520 Jul 29  2006 orannts9.dll
-rw-rw-rw-   1 user     group       28944 Jul 29  2006 orannzentr9.dll
-rw-rw-rw-   1 user     group      586000 Jul 29  2006 orannzsbb9.dll
-rw-rw-rw-   1 user     group       24848 Jul 29  2006 oranoname9.dll
-rw-rw-rw-   1 user     group       57616 Jul 29  2006 oranoncj9.dll
-rw-rw-rw-   1 user     group      225552 Jul 29  2006 oranro9.dll
-rw-rw-rw-   1 user     group       41232 Jul 29  2006 oransgr9.dll
-rw-rw-rw-   1 user     group       49424 Jul 29  2006 orantcp9.dll
-rw-rw-rw-   1 user     group       28944 Jul 29  2006 orantns9.dll
-rw-rw-rw-   1 user     group       57784 Jul 29  2006 oraobjop9.dll
-rw-rw-rw-   1 user     group      311568 Jul 29  2006 oraocci9.dll
-rw-rw-rw-   1 user     group       24848 Jul 29  2006 oraodm9.dll
-rw-rw-rw-   1 user     group     2314240 Jun 26  2006 oraolapapi9.dll
-rw-rw-rw-   1 user     group       57784 Jul 29  2006 oraolapop9.dll
-rw-rw-rw-   1 user     group      377104 Jul 18  2006 oraordim9.dll
-rw-rw-rw-   1 user     group      246032 Apr 29  2002 oratrace9.dll
-rw-rw-rw-   1 user     group       86288 Apr 29  2002 oratracepls9.dll
-rw-rw-rw-   1 user     group       24848 Jul 29  2006 oravsn9.dll
-rw-rw-rw-   1 user     group       24576 Mar 29  2005 orawsec9.dll
-rw-rw-rw-   1 user     group       24848 Jul 29  2006 orawtc9.dll
-rw-rw-rw-   1 user     group      191248 Apr 16  2001 orawwg9.dll
-rw-rw-rw-   1 user     group      151552 Feb  8  2002 vspp97.dll
-rw-rw-rw-   1 user     group       65536 Feb  8  2002 vsqp9.dll
-rw-rw-rw-   1 user     group      122880 Feb  8  2002 vsw97.dll

dbms=:
total 0
drwxrwxrwx   1 user     group           0 Oct 22  2013 mesg

dbms\mesg=:
total 28
-rw-rw-rw-   1 user     group        8704 Oct  4  2012 bbedus.msb
-rw-rw-rw-   1 user     group       10270 Oct  4  2012 bbedus.msg
-rw-rw-rw-   1 user     group        7680 Apr 26  2008 bbedzhs.msb.xxx

--//我估計好多dll是不需要的.

2.建立如下檔案:

D:\tools\bbed>cat bbed.par
blocksize=8192
listfile=d:\tools\bbed\filelist.txt
mode=edit
PASSWORD=blockedit

D:\tools\bbed>cat cmd.par
set count 128
set width 210

--//如果顯示寬度不足,可以設定width小一些.

D:\tools\bbed>cat bbed1.bat
@echo off
bbed parfile=bbed.par cmdfile=cmd.par

3.建立filelist.txt檔案:
SYS@test> select file#||''||name c80 from v$dbfile ;
C80
-------------------------------------------------------------------
6 D:\APP\ORACLE\ORADATA\TEST\USERS01.DBF
5 D:\APP\ORACLE\ORADATA\TEST\UNDOTBS01.DBF
3 D:\APP\ORACLE\ORADATA\TEST\SYSAUX01.DBF
1 D:\APP\ORACLE\ORADATA\TEST\SYSTEM01.DBF
2 D:\APP\ORACLE\ORADATA\TEST\PDBSEED\SYSTEM01.DBF
4 D:\APP\ORACLE\ORADATA\TEST\PDBSEED\SYSAUX01.DBF
7 D:\APP\ORACLE\ORADATA\TEST\TEST01P\SYSTEM01.DBF
8 D:\APP\ORACLE\ORADATA\TEST\TEST01P\SYSAUX01.DBF
9 D:\APP\ORACLE\ORADATA\TEST\TEST01P\SAMPLE_SCHEMA_USERS01.DBF
10 D:\APP\ORACLE\ORADATA\TEST\TEST01P\EXAMPLE01.DBF
10 rows selected.

--將結果copy and paste到filelist.txt.

4.使用注意:
SCOTT@test01p> select rowid,dept.* from dept;

ROWID                  DEPTNO DNAME          LOC
------------------ ---------- -------------- -------------
AAAWh9AAJAAAACFAAA         10 ACCOUNTING     NEW YORK
AAAWh9AAJAAAACFAAB         20 RESEARCH       DALLAS
AAAWh9AAJAAAACFAAC         30 SALES          CHICAGO
AAAWh9AAJAAAACFAAD         40 OPERATIONS     DALLAS

SCOTT@test01p> @ rowid AAAWh9AAJAAAACFAAA
    OBJECT       FILE      BLOCK        ROW DBA                  TEXT
---------- ---------- ---------- ---------- -------------------- ----------------------------------------
     92285          9        133          0 9,133                alter system dump datafile 9 block 133 ;

--//使用注意一點,比如要訪問上面的塊,block要加1.例子:
BBED> set dba 9,134
        DBA             0x02400086 (37748870 9,134)
--//注意block+1,不過很奇怪的問題是在9i下測試,就不需要+1,不知道為什麼?

BBED> p kdbr
sb2 kdbr[0]                                 @118      8062
sb2 kdbr[1]                                 @120      8040
sb2 kdbr[2]                                 @122      8020
sb2 kdbr[3]                                 @124      7996
sb2 kdbr[4]                                 @126     -1

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

BBED> x /rncc
rowdata[436]                                @8162
------------
flag@8162: 0x2c (KDRHFL, KDRHFF, KDRHFH)
lock@8163: 0x00
cols@8164:    3

col    0[2] @8165: 10
col   1[10] @8168: ACCOUNTING
col    2[8] @8179: NEW YORK

BBED> verify
DBVERIFY - Verification starting
FILE = D:\APP\ORACLE\ORADATA\TEST\TEST01P\SAMPLE_SCHEMA_USERS01.DBF
BLOCK = 133
--//這裡有正確了.

--//OK,現在可以正常使用了.需要的可以從這裡下載:
--//
--//不要在生產系統上使用這些特殊的工具.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2109019/,如需轉載,請註明出處,否則將追究法律責任。

相關文章