Showing posts with label Logical Structure. Show all posts
Showing posts with label Logical Structure. Show all posts

Monday, July 27, 2020

Oracle Database Logical Structure

Logical Structure :

 In Oracle Database Logical structure  gives the mandate or direction  like, how the physical space of database is used. Oracle Database Allocates logical space for all data in the database.

The Logical units of Database Space allocation are Data Blocks, Extents, Segments, Tablespaces.

A Logical Structure hierarchy exists as fallows :

  • An Database contains at least one tablespace.
  • A tablespace contains one or more  segments.
  • A  Segment is made up of extents.
  • An Extent is made up of logical Blocks.
  • A Block is the smallest Unit for read and Write Operations.

The oracle database architecture includes logical and physical structures that make up the database.

  • The Physical structure includes the control files, online redo log files, and Data files that make up the database.
  • The Logical Structure includes  Tablespaces, Segments, Extents, and Data Blocks.

The Oracle Server enables fine- grained control of disk space use through tablespace  and logical storage structures, including segments, Extents and Data blocks.

Tablespaces:  

The data is an Oracle Database is stored in tablespaces.

  • An Oracle database can be logically grouped into smaller logical areas of space known as tablespaces.
  • A tablespace can belong to only one database at a time.
  • Each tablespace consists of one or more operating system files, which are called data files.
  • A tablespace may contain one or more segments.
  • Tableapaces can be brought online while the database is running.
  • Except for the SYSTEM tablesoace Or a tablespace with an active UNDO Segments, tablespace can be taken offline, Leaving the database running.
  • Tablespaces can be switched between Read/Write and Read- Only Status.

Data Files (Not a Logical Structure ) :

  • Each tablespace in an Oracle Database consist of one or more files called data files. These are Physical structures that Conforms with the operating system on which the Oracle Server is running.
  • A datafile can belongs to only one tablespace.
  • An Oracle Server Creates a datafile for a tablespace by allocating the specified amount of disk space plus a small amount of overhead.
  • The Database Administrator can change the size of a datafile after its creation or can specify that a datafile should dynamically grow as objects in the tablespace Grow.

Segments :  

  • A segment is space allocated for a specific Logical storage structure within a tablespace.
  • A tablespace may consist of one or more segments
  • A segment cannot span tablespaces, However, a segment can span multiple datafiles that belongs  to the same tablepsace.
  • Each segment is made up of one or more Extents
Extents :

Space is Allocated to a segment by Extents.

  • One or more Extents make up a segments.
    • When a segment is created, it Consist of at least One Extent.
    • As the segment Grows, Extent are added to the segment.
    • The DBA can manually add extents to a segment
  • An Extent is a set of Contiguous Oracle Blocks.
  • An Extent cannot Span Data files, and therefore, It Must exists in one Datafils.

 

Data Blocks :

The Oracle Server manages the storage space in the oracle datafiles in units called Oracle Blocks Or Data Blocks.

  • At the finest level of  granularity, The data in an Oracle Database is stored in data Blocks.
  • Oracle Data Blocks are the smallest unit of storage that the Oracle Server can Allocates, read, Or Writes.
  • One Data block Corresponds to one or more operating system blocks from an existing Data file.
  • The Standard Data Block size for an Oracle Database is specified by the DB_BLOCK_SIZE  initialization Parameter when database  is created.
  • The Data Block Size should be a multiple of the operating system block size to avoid Unnecessary I/O.
  • The Maximum Data Block Size  is dependent on the Operating System. 

 

Thank you !!