0% found this document useful (0 votes)
118 views

Block (Oracle Block) : Recursive SQL

The document discusses Oracle database concepts including blocks, extents, segments, tablespaces, extent management options of locally managed tablespaces (LMT) and dictionary managed tablespaces (DMT), and segment types including table, index, undo, and temporary segments. Key points are: Blocks store data in bytes and actual data is stored in blocks when inserted. Extents are collections of blocks and segments are collections of extents. Tablespaces are collections of segments that contain data files physically. There are two extent management options - LMT stores extent information in data file headers while DMT stores in data dictionary tables.

Uploaded by

namireddysathish
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views

Block (Oracle Block) : Recursive SQL

The document discusses Oracle database concepts including blocks, extents, segments, tablespaces, extent management options of locally managed tablespaces (LMT) and dictionary managed tablespaces (DMT), and segment types including table, index, undo, and temporary segments. Key points are: Blocks store data in bytes and actual data is stored in blocks when inserted. Extents are collections of blocks and segments are collections of extents. Tablespaces are collections of segments that contain data files physically. There are two extent management options - LMT stores extent information in data file headers while DMT stores in data dictionary tables.

Uploaded by

namireddysathish
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Block (Oracle Block)

 Storing the data in terms of bytes


 Actual data will be stored in Blocks while inserting

Extent
 A collection of Blocks

Segment
 A collection of Extents

Tablespace
 A collection of Segments

Extent Management
 It decides how the extents are managed
 We have 2 options for managing the extents

2 Options
 Locally Managed Tablespace (LMT)
 Dictionary Managed Tablespace (DMT)

Dictionary Managed Tablespace (DMT)


 Default in Oracle 9i
 In this the free space information is stored in the data dictionary tables (UET$,
FET$)
 UET$  Used Extents, FET$  Free Extents

SCOTT INSERT operation

Step1: It checks the information about the free extents in UET$ and FET$ data
dictionary tables
Step2: To get the data from the Oracle Data Dictionary Tables, Oracle will in turn write
queries. This is known as RECURSIVE SQL
Step3: Changes are written to the Redo Log Buffer finally to the Redo Log Files
(Means here UNDO & REDO is getting generated)
Example: Here REDO is INSERT Operation, than UNDO will be DELETE operation

Dictionary Managed Tablespaces drawbacks


 Recursive SQL (Results in Fragmentation of the tables)
 Redo data is generated
 Coalesce (Gather) the free extents manually
Locally Managed Tablespace (LMT)
Default in Oracle 10g
In this the extents information will be stored in Data File Headers in the form of a bit
maps

Data File
 It stores committed data
 Each data file is identified by FILE ID
 Each data file will have one header
 The header stores the data file id, Bit maps

Bit maps
 Each bitmap represents a block or a set of blocks

Example:
 If bitmap=0 then space is available in that block
 If bitmap=1 then space is not available in that block

SCOTT: INSERT operation

Step1: It checks the information about the free extents in data file headers in the form
of a bitmaps

Locally Managed Tablespace advantages


 Reduced recursive space management
 Reduced contention on data dictionary tables
 No rollback generated
 No coalescing required

Segment types
 Table
 Index
 Undo
 Temporary
Table Segment
In this the data will be stored in the columns and rows

Index Segment
It stores the information about the Indexes

Index
It is a pointer which points to the physical address of a row in a table

Undo Segment
It store pre-image data

Example:

SCOTT: updated salary from 9k to 15k (Not committed)

What is the salary value viewed by Scott: 15k (Write Consistency)


What is the salary value viewed by Smith: 9k (Read Consistency)

Where this 9k value is getting stored?


 Undo Segment

Temporary Segment
 If PGA is not sufficient for sorting then Server Process uses temporary segment
for sorting operations

Tablespace (Logically)
 It logically contains Segments
 Segments contains Extents
 Extents contains oracle blocks

Tablespace (Physically)
 Contains data file

Tablespace types
 System Tablespace
 Non System Tablespace
 Temporary Tablespace
 Undo Tablespace
System Tablespace
 It stores Meta data

Meta data
 Data about data

SYSAUX table space


 Introduced from Oracle 10g
 It is called as SYSTEM AUXILARY table space
 It is mandatory from Oracle 10g
 It stores all the statistical information related to the performance issues

Example:
How many sessions are running?
Which top5 statements are consuming more resource?

Undo Tablespace
 Only one undo table space should be active at a time
 It stores Undo Segment

Temporary Tablespace
It stores temporary segments

Application Tablespaces
Defined & designed by the user according to his requirement

Tablespace Management
AUTOEXTEND ON

You might also like