Primer on Primer on Structure Structure & & Storage Analysis Storage Analysis This presentation is supposed to give a simple and brief overview for storage calculations. THREE simple methods have been discussed for TABLE size calculation. ~ Nilendu Misra [email protected]
25
Embed
Primer on Structure& Storage Analysis Primer on Structure & Storage Analysis This presentation is supposed to give a simple and brief overview for storage.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Primer on StructurePrimer on Structure & & Storage AnalysisStorage Analysis
This presentation is supposed to give a simple and brief overview for storage
calculations. THREE simple methods have been discussed for TABLE size calculation.
Data block is the smallest unit logical space allocation
Smallest unit of I/O Data block size can ONLY be specified at
creation time Always multiple of OS block size To see check DB_BLOCK_SIZE in init.ora
Oracle Block
Data Block = Header + “Actual” data
Header contains ‘information’about the data
A row should ideally be contained within a single
block
Header Data
Row
Free Space
Extent & Segment
An extent is a specific number of contiguous data blocks
Several extents make one segment(e.G table, rollback segment)
All extents for the same segment are on the same tablespace
Rollback segment has ATLEAST 2 extents
Free Space Management : PCTFREE Mention while creating or altering segment FREELIST - list of blocks ready for insertion % of the block kept free for updates of rows
already in that block PCTFREE = 10 (default) means the block
(say 2K) allows row insertion till it is 80% full (1.8K). The rest (0.2K) is kept free
Pctused
When % of the block used falls below PCTUSED insertion is again allowed on the block
PCTUSED = 40 (default), in the previous example means when the block will contain 0.8K then again insertion will start
Why Consider these Parameters?
Disk I/O is the around 50 times slower than reading from memory (SGA)
We should prevent multiple I/Os while reading a record (e.g., Row Chaining)
This parameters put a big role in the total space consumed by the segment
Read-in blocks take up memory in SGA Defining depends on the application (e.g.,
UPDATE intensive)
CONT.
e.g., In UPDATE intensive system PCTFREE should be high to accommodate the INCREASE in length due to UPDATE
In SELECT intensive system (say DSS) PCTFREE should be low. (As no UPDATE)
A Table can be INSERTed / DELETEd upon frequently. So HIGH PCTUSED is better
Row chaining– Row is ‘spread across’ more than one block
Designing Parameters
Knowledge of application data. Knowledge of operations on individual Table
(particularly Large ones)
Specifically the frequency of UPDATEs, INSERTs, DELETEs has to be known
A row with LONG datatype normally ‘spreads across’ multiple data blocks
Row Chaining
When a row is stored over multiple blocks Because it does not get enough space on a
single block to fit in With large rows (with LONG,LONG RAW) I/O is badly hit for scanning multiple blocks
EXTENT Calculation
MAXEXTENTS depend on data block size For 2K block, MAXEXTENT = 121 When one extent is filled, NEXT extent is