Skip to main content

Storage - Oracle Architecture

Logical Storage

Blocks

Data Block is the smallest unit of logical storage for a database object.

Extents

Extends is the next level of logical grouping in the database. An extent contains one or more database blocks.

Segments

The next level of logical grouping in a database in the segments. A segment is a group of extents from a database object that Oracle treats as a unit.


  • Data Segments: Every table in the database resides in a single data segment, consisting of one or more extents.
  • Index Segments: Each index is stored in its own index segment. As with partitioned tables, each partition of a partitioned index is stored in its own segment.
  • Temporary Segments: When a user's SQL statement needs disk space to complete an operation such as a sorting operation that cannot fit in memory, Oracle allocates a temporary segment. Temporary segments exist only for the duration of SQL execution.
  • Rollback Segments: Rollback Segments only exists in the SYSTEM tablespace, and typically the DBA doesn't need to maintain the SYSTEM rollback segment.


Comments

Popular posts from this blog

Insert script with multiple cursors and condition check

DECLARE CURSOR C1 IS   SELECT ID FROM TABLE_NAME_1 WHERE COLUMN IN ('');   CURSOR C2     IS       SELECT ID FROM TABLE_NAME_2 WHERE COLUMN IN ('');              CURSOR C3 (CP_TABLE_01_ID NUMBER,CP_TABLE_02_ID NUMBER)         IS           SELECT COUNT(*) AS COUNT_UP           FROM TABLE_NAME_3           WHERE COLUMN_CONDITION_01=CP_TABLE_02_ID           AND COLUMN_CONDITION_02=CP_TABLE_01_ID; COUNT_UP NUMBER; BEGIN FOR R1 IN C1 LOOP     FOR R2 IN C2     LOOP          OPEN C3(R1.ID,R2.ID);        FETCH C3 INTO COUNT_UP;        CLOSE C3;               IF (COUNT_UP=0) THEN           INSERT           INTO TABL...

REF Cursor

REF CURSOR WILL BE DYNAMICALLY OPENS OR OPEN BASED ON A LOGIC. DECLARE TYPE C1 IS REF CURSOR ; CURSOR C IS SELECT * FROM DUAL; REF_CURSOR RC; BEGIN IF (TO_CHAR(SYSDATE, 'DD' ) = 30 ) THEN OPEN REF_CURSOR FOR 'SELECT * FROM TABLE1' ; ELSIF ( TO_CHAR(SYSDATE, 'DD' ) = 29 ) THEN OPEN REF_CURSOR FOR SELECT * FROM TABLE2; ELSE OPEN REF_CURSOR FOR SELECT * FROM DUAL; END IF ; OPEN C; END ;