SEGMENT EXTENTS ORACLEBLOCK

1.SEGMENT:

       allocated for a specific data structure

       Oracle allocates space for segments in units of one extent.

       A segment and all its extents are stored in one tablespace

       segment can span datafiles

       table,index,temporary,undo

2.EXTENTS:

       An extent is a specific number of contiguous data blocks.

       Oracle allocates space for segments in units of one extent.

       each extent can contain data from only one datafile.

       alter table t allocate extent(size 1m datafile '');

       alter table t deallocate unused;

3.BLOCK:

       Although you can allocate additional extents, the blocks themselves are allocated separately. If you allocate an extent to a specific instance, the blocks are immediately allocated to the free list. However, if the extent is not allocated to a specific instance, then the blocks themselves are allocated only when the high water mark moves. The high water mark is the boundary between used and unused space in a segment.

        A data block is the smallest unit of data used by a database

        Data Block Format:Header,Table Directory,Row Directory,Free Space,Row Data

        Row Chaining and Migrating

In two circumstances, the data for a row in a table may be too large to fit into a single data block. In the first case, the row is too large to fit into one data block when it is first inserted. In this case, Oracle stores the data for the row in a chain of data blocks (one or more) reserved for that segment. Row chaining most often occurs with large rows, such as rows that contain a column of datatype LONG or LONG RAW. Row chaining in these cases is unavoidable.

However, in the second case, a row that originally fit into one data block is updated so that the overall row length increases, and the block's free space is already completely filled. In this case, Oracle migrates the data for the entire row to a new data block, assuming the entire row can fit in a new block. Oracle preserves the original row piece of a migrated row to point to the new block containing the migrated row. The rowid of a migrated row does not change.

When a row is chained or migrated, I/O performance associated with this row decreases because Oracle must scan more than one data block to retrieve the information for the row.

         PCTFREE,PCTUSE,initrans,maxtrans,freelists

        

4. STRUCTURE OF THE ROW

    generally, a row of table sore in a block.  null columns can not sore in block.

    head: the numbers of columns in a row. chain information. lock status.

    row data: column length. column value. the slot  of the Row Directory in the block point to the begining of the row.

        

   

猜你喜欢

转载自killdbs.iteye.com/blog/1312377