Subject: GLOSSARY: DBA - Data Block Address Creation Date: 22-SEP-1997 Oracle Data Block Address (DBA): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Each block in an Oracle database is identified by a unique file and block number combination. These are represented internally in Oracle 7 as a 'DBA' or 'Data Block Address' using 4 bytes. Below we show how a file & block number translates into a 4 byte DBA. For historical reasons we will show a version 6 DBA first then extend this to show an Oracle7 DBA. The exact representation is PORT SPECIFIC so we will take an example here of Sequent. This uses a 6 bit file number in Oracle 6. Oracle 6: ~~~~~~~~~ Assume we are looking at file 8, block 56892, this will be represented (in binary) as: 26 bit block number == 56892 vv vvvvvvvv vvvvvvvv vvvvvvvv 00100000 00000000 11011110 00111100 ^^^^^^ 6 bit file number == 8 Ie: the top 6 bits (on Sequent) represent the file number, while the bottom 26 bits represent a block number within a file. Oracle 7: ~~~~~~~~~ In Oracle 6 the number of bits used for the file portion of the DBA is quite small (as low as 5 bits on some platforms) and hence limits the maximum number of files in a database. Eg: 2^6 = 64 files maximum. But all bits = ZERO and all bits = ONE are special cases so the actual maximum files was 62 (Sequent). 2^5 = 32 files maximum !! In Oracle 7 extra bits were needed for the file number to allow more files. These extra bits are 'stolen' from the top of the BLOCK number and the FILE number 'wraps' into these bits to allow backwards compatibility thus (in binary on Sequent): FFFFFFHH HHBBBBBB BBBBBBBB BBBBBBBB FFFFFF = low order 6 bits of the FILE number HHHH = high order 4 bits of the FILE number BBBBBB BBBBBBBB BBBBBBBB = BLOCK number (22 bits) This means that file 8, block 56892 is still represented EXACTLY the same as in Oracle6, but now we have 10 bits for the FILE number. Eg: File 255, block 56892 is represented as: 11111100 11000000 11011110 00111100 F C C 0 D E 3 C \_____/\___/\_______________________/ | | | | | Block = 0xDE3C = 56892 \_____________ | \ V V 0011 111111 = 0xFF = 255 This strange 'wrapping' allows more datafiles AND backwards compatibility to version 6 block addressing for migrated databases. Port Specifics: ~~~~~~~~~~~~~~~ To add confusion different ports use different number of bits for each portion of the DBA. There are basically 2 numbers used to determine the 'split' points of the DBA. These are shown below with example settings. <-File Bits-> Low Platform Order Total DBA Bit Layout ~~~~~~~~ ~~~~ ~~~~~ ~~~~~~~~~~~~~~ Sequent V6 6 6 FFFFFFbb bbbbbbbb bbbbbbbb bbbbbbbb Sequent V7 6 10 FFFFFFHH HHbbbbbb bbbbbbbb bbbbbbbb AIX V7 8 10 FFFFFFFF HHbbbbbb bbbbbbbb bbbbbbbb MVS 12 12 FFFFFFFF FFFFbbbb bbbbbbbb bbbbbbbb ODBA: See [NOTE:30322.1] for instructions on using 'odba'. ~~~~~ There is a support tool called ODBA to do all the conversions for you. All you need to know for a given platform is the bit split as shown above. The main port splits are shown in the 'odba' output. Determining the Bit Split: ~~~~~~~~~~~~~~~~~~~~~~~~~~ If you dont know the bit split for a platform simply issue the following statements: select dump(chartorowid('00000000.0000.0001')) from dual; select dump(chartorowid('00000000.0000.ffff')) from dual; These will allow you to work out the split by displaying the internal representation of the DBA for file 1 and file N (where N is the maximum file number allowed) Eg: On Sequent: SQLDBA> select dump(chartorowid('00000000.0000.0001')) from dual; Typ=69 Len=6: 4,0,0,0,0,0 ^^^^^^^ | Convert these decimal bytes to BINARY: 00000100 00000000 00000000 00000000 ^^^^^^-- There are 6 LOW ORDER file bits SQLDBA> select dump(chartorowid('00000000.0000.ffff')) from dual; Typ=69 Len=6: 255,192,0,0,0,0 ^^^^^^^^^^^ | Convert these decimal bytes to BINARY: 11111111 11000000 00000000 00000000 ^^^^^^^^^^^-- There are 10 file bits in total So we have a DBA that uses a 6,10 split. Oracle 7.2 / 7.3 ~~~~~~~~~~~~~~~~~ In Oracle 7.2 onwards you can use DBMS_UTILITY to do conversions for you. Eg: In Server Manager: DBA -> FILE , BLOCK ~~~~~~~~~~~~~~~~~~~ variable file# number variable block# number execute :file#:=dbms_utility.data_block_address_file(335596957); execute :block#:=dbms_utility.data_block_address_block(335596957); print file# print block# FILE , BLOCK -> DBA ~~~~~~~~~~~~~~~~~~~ variable DBA number execute :DBA:=dbms_utility.make_data_block_address(5,52637); print DBA