Oracle … as usual

Oracle by Laurent Leturgez

Do you want to use BBED … on Windows ???

Recently, I had to use BBED in a windows 2008 R2 environment (to modify a checkpoint SCN in datafiles headers). To do this, I like to use BBED but this time, it was on a Windows 2008 R2 server on a 11.2 database.

2 problems :

– BBED is not shipped with Oracle since version 9.

– There’s no makefile on windows to compile bbed.

In a previous post, I wrote a little hack to compile bbed on Unix systems and to use it with oracle 9, 10, 11 and every database that have its datafiles located on a mount point (not for ASM).

On windows, to bypass this, you can copy your datafiles on a linux box, repair them with bbed, and copy them back to their original location. But when you work remotely or/and your database size is hundreds of Gigabytes … the problem is different.

So, if you want to use bbed on windows, you need to have many things:

  1. You need a bbed.exe. The only way is to get it from an Oracle 9i installation.
  2. You need to have a bunch of DLL (see above). All thoses DLLs are available in an Oracle 9i installation (in bin directory).
      • oraclient9.dll
      • oracommon9.dll
      • orageneric9.dll
      • ORACORE9.DLL
      • oraldapclnt9.dll
      • oran9.dll
      • ORANCDS9.DLL
      • orancrypt9.dll
      • oranhost9.dll
      • oranl9.dll
      • oranldap9.dll
      • ORANLS9.DLL
      • oranms.dll
      • oranmsp.dll
      • orannzsbb9.dll
      • oranoname9.dll
      • oranro9.dll
      • orantns9.dll
      • ORAPLS9.DLL
      • ORASLAX9.DLL
      • ORASNLS9.DLL
      • ORASQL9.DLL
      • oratrace9.dll
      • ORAUNLS9.DLL
      • oravsn9.dll
      • orawtc9.dll
      • ORAXML9.DLL
      • ORAXSD9.DLL
  3. You need message files for BBED. Thoses files are “bbedus.msb” and “bbedus.msg”. They are located in the mesg directory of an Oracle 9i installation. And you need to copy them in the rdbms\mesg directory of your  ORACLE_HOME.

 

If you have all these files (if not, let me know 😉 ), put them in a directory for your  bbed installation (let’s say c:\bbed), and set your ORACLE_HOME to the location where have put the message files, and finally launch BBED :

C:\bbed>dir /w
 Volume in drive C has no label.
 Volume Serial Number is 941A-E20F

 Directory of C:\bbed

[.]                [..]               bbed.exe           log.bbd            [mesg]             oraclient9.dll     oracommon9.dll     ORACORE9.DLL
orageneric9.dll    oraldapclnt9.dll   oran9.dll          ORANCDS9.DLL       orancrypt9.dll     oranhost9.dll      oranl9.dll         oranldap9.dll
ORANLS9.DLL        oranms.dll         oranmsp.dll        orannzsbb9.dll     oranoname9.dll     oranro9.dll        orantns9.dll       ORAPLS9.DLL
ORASLAX9.DLL       ORASNLS9.DLL       ORASQL9.DLL        oratrace9.dll      ORAUNLS9.DLL       oravsn9.dll        orawtc9.dll        ORAXML9.DLL
ORAXSD9.DLL        [rdbms]
              30 File(s)     12 870 233 bytes
               4 Dir(s)  26 325 200 896 bytes free
C:\bbed>echo %ORACLE_HOME%
c:\oracle\product\10.2.0\db_1

C:\bbed>dir /w %ORACLE_HOME%\rdbms\mesg
 Volume in drive C has no label.
 Volume Serial Number is 941A-E20F

 Directory of c:\oracle\product\10.2.0\db_1\rdbms\mesg

[.]          [..]         bbedus.msb   bbedus.msg   kfodus.msb   nmaf.msb     nmaus.msb    nmef.msb     nmeus.msb
               7 File(s)         72 222 bytes
               2 Dir(s)  26 404 503 552 bytes free

C:\bbed>systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type"
OS Name: Microsoft Windows Server 2008 R2 Enterprise
OS Version: 6.1.7601 Service Pack 1 Build 7601
System Type: x64-based PC

C:\bbed>.\bbed
Password:

BBED: Release 2.0.0.0.0 - Limited Production on Mon Jun 17 14:46:38 2013

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

************* !!! For Oracle Internal Use only !!! ***************

Now, you have a bbed exe on Windows 2008 R2 server.

Advertisements

8 responses to “Do you want to use BBED … on Windows ???

  1. Lincoln July 5, 2013 at 1:42 AM

    This is very helpful however I have all the dll files but no bbed.exe am running Oracle 9.0.1.1.1 I have search every where in the Oracle_Home/ but no bbed.exe Help

  2. gonzo38 June 3, 2014 at 10:26 AM

    Hello,
    I just read your article, and find it wery helpfull. But I can’t get the source files as I don’t have the 9i source files any more. Could you please help me ?

    Thanks.

    Regards.

  3. zhwsh June 1, 2016 at 4:38 AM

    SCOTT@book> @ &r/ver1
    PORT_STRING VERSION BANNER
    —————————— ————– ——————————————————————————–
    x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production

    SCOTT@book> create table dept2 tablespace tea as select * from dept ;
    Table created.

    SCOTT@book> select ora_rowscn,rowid,dept2.* from dept2 ;
    ORA_ROWSCN ROWID DEPTNO DNAME LOC
    ———— —————— ———— ————– ————-
    13238134154 AAAW9NAAHAAAACDAAA 10 ACCOUNTING NEW YORK
    13238134154 AAAW9NAAHAAAACDAAB 20 RESEARCH DALLAS
    13238134154 AAAW9NAAHAAAACDAAC 30 SALES CHICAGO
    13238134154 AAAW9NAAHAAAACDAAD 40 OPERATIONS BOSTON

    SCOTT@book> @ &r/rowid AAAW9NAAHAAAACDAAA
    OBJECT FILE BLOCK ROW DBA TEXT
    ———— ———— ———— ———— ——————– —————————————-
    94029 7 131 0 7,131 alter system dump datafile 7 block 131 ;

    –why in bbed for windows
    set dba 7,132

    131+1 ? why ?

    • Laurent June 14, 2016 at 2:51 PM

      maybe the header block

      • zhwsh June 15, 2016 at 8:41 AM

        thank you! 9i header block(Os block) ang 10g ,11g header block(os block) is diff.

        D:\tools\bbed>od -tx1 -N 8192 INDX01.DBF
        od -tx1 -N 8192 INDX01.DBF
        0000000 00 00 00 00 00 20 00 00 00 05 00 00 6d 6c 6b 6a
        0000020 06 23 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        *
        0020000
        –9i os block

        D:\tools\bbed>od -tx1 -N 8192 tea01.dbf
        od -tx1 -N 8192 tea01.dbf
        0000000 00 a2 00 00 00 00 c0 ff 00 00 00 00 00 00 00 00
        0000020 66 ff 00 00 00 20 00 00 00 05 00 00 7d 7c 7b 7a
        0000040 a0 81 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        0000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        *
        0020000
        –11g os block

  4. Armin December 12, 2016 at 8:55 PM

    Very helpful, thanks. but I can’t find bbed.exe and bbedus.msg, where can I find that? (I have all dlls)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: