Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: oracle internal storage of numbers

Re: oracle internal storage of numbers

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 30 Oct 1998 23:27:24 +0100
Message-ID: <363A3D4C.EEC82FCB@sybrandb.demon.nl>


Hi Sandy,
Numbers are stored packed (two digits in a byte) with a length byte in front of them. I'm not sure what you are up to and why you are not using normal recovery mechanisms, but then you were probably not running in archivelog before this happened. Be aware that each database file has a database header (one block per file) and each table has a table header (one block per table). I doubt whether you will be able to recover by working with octal dumps, but good luck anyway,

Hth,

Sybrand Bakker, Oracle DBA

Sandy Jeffers wrote:

> Question,
>
> My company had a crash and we very much need
> to recover some data. To do this, I need to
> know how to decode number formats?
>
> How I tried to decode 'em
> ---------------------------
>
> First thing that I did was to create a simple
> table with two fields. Field 1 was a number and
> Field 2 was a string. I then preceded to stuff
> various number,string combos in the table. I'd
> then od the file underlying
> the tablespace underlying the table in question.
>
> create table delme2(foo1 number(38), foo2 varchar2(256))
> tablespace test_crash;
> insert into delme2 values (0, 'abc');
> insert into delme2 values (10, 'def');
> insert into delme2 values (150, 'ghi');
> insert into delme2 values (2100, 'qrstu');
> insert into delme2 values (1, 'dddd');
> insert into delme2 values (2, 'eeee');
> insert into delme2 values (3, 'fff');
> insert into delme2 values (4, 'ggg');
> insert into delme2 values (20, 'hhh');
> insert into delme2 values (30, 'iii');
> insert into delme2 values (160764, 'jjj');
> insert into delme2 values (66027, 'tiel');
>
> The goal was to insert numbers in such a way
> that a pattern could be discerned. I couldn't.
> But any help would be appreciated.
>
> -Sandy
>
> *
> od -c -j 077000 test2.dbf
> 0000000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
> *
> 0000560 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 , 001 002 004 303
> 0000600 007 = 034 004 t i e l , \0 002 004 303 021 \b A
> 0000620 003 j j j , \0 002 002 301 037 003 i i i , \0
> 0000640 002 002 301 025 003 h h h , \0 002 002 301 005 003 g
> 0000660 g g , \0 002 002 301 004 003 f f f , \0 002 002
> 0000700 301 003 004 e e e e , \0 002 002 301 002 004 d d
> 0000720 d d , \0 002 002 302 026 005 q r s t u , \0
> 0000740 002 003 302 002 3 003 g h i , \0 002 002 301 013 003
> 0000760 d e f , \0 002 001 200 003 a b c \0 001 \0 017
> 0001000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
> *
> ^?# od -b -j 077000 test2.dbf
> 0000000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
> *
> 0000560 000 000 000 000 000 000 000 000 000 000 000 054 001 002 004 303
> 0000600 007 075 034 004 164 151 145 154 054 000 002 004 303 021 010 101
> 0000620 003 152 152 152 054 000 002 002 301 037 003 151 151 151 054 000
> 0000640 002 002 301 025 003 150 150 150 054 000 002 002 301 005 003 147
> 0000660 147 147 054 000 002 002 301 004 003 146 146 146 054 000 002 002
> 0000700 301 003 004 145 145 145 145 054 000 002 002 301 002 004 144 144
> 0000720 144 144 054 000 002 002 302 026 005 161 162 163 164 165 054 000
> 0000740 002 003 302 002 063 003 147 150 151 054 000 002 002 301 013 003
> 0000760 144 145 146 054 000 002 001 200 003 141 142 143 000 001 000 017
> 0001000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
> *
Received on Fri Oct 30 1998 - 16:27:24 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US