Monday, April 11, 2011

How do I get the Block Header Size in Oracle?

I'm trying to calculate the size of a few tables as stated here, but I can't find the block header size variable

How do I get it? Is it some kind of formula?

I'm using Oracle 10g

From stackoverflow
  • This page (for 10g) says it's 57 bytes.

    Juan Manuel : I saw that, but I think it's just one part of the "whole block header"
    paxdiablo : The block header size is 57 bytes, did you mean the block size?
    paxdiablo : Or the actual overhead which is discussed on that page as well (block header, transaction header, table directory, ...)?
  • This site has a good discussion on the format of the block header: http://www.adp-gmbh.ch/ora/concepts/db_block.html. Basically the block header = fixed header + transaction header + table directory + row directory. Here are the individual pieces:

    fixed header = 57 bytes

    transaction header = between 23*inittrans and 23*maxtrans

    table directory = 4*number of tables (usually 1 unless you're using clusters)

    row directory = 2*stored rows

    In short while you can come up with a rough estimate, it's not a fixed size for each data block.

    paxdiablo : Those "=" chars, I assume they're meant to be "+" chars, yes?
    Shawn Loewen : I edited the answer to make the formatting a bit clearer.
    paxdiablo : Okay, looks like that's what the Q'er was after, +1.

0 comments:

Post a Comment