Atikh's DBA blog
  • Home
  • Oracle
  • MySQL
  • MongoDB
  • PostgreSQL
  • Snowflake
  • About Me
  • Contact Us

Oracle Database Architecture Physical and Logical

 Atikh Shaikh     oracle     No comments   

Database is combination of physical and logical storage structure. pictorial view will look like below figure.




DBA will be able see both views but for developer physical view is unknown and it won't affect its functionality as it whether it is moved to re-organized.

we can see there is one dotted line between datafile and segment, because its non -direct relationship as tablespace contains many segments and same is made up of many datafiles.


Logical View

Tablespace: Tablespace is collection of number of segments which may contain one or more datafiles depending on type of tablespace i.e. normal or smallfile will have number of datafiles and bigfile tablesapce will have single datafile with huge maxsize. tablespace names are unique in database.
we can query the tablespace names using dba_tablespaces view

SQL> select distinct tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSAUX
TEMP
USERS
SYSTEM
UNDO

Segment: This entity represent any database objects say table, index that store data and hence required space in tablespace. Many segments will combine in single tablespace.





Extent: Managing space one block at a time is difficult task so oracle blocks are grouped together to form extent. Extent is consecutively numbered Oracle Blocks within on datafile. Every segment is consisting of number of extents.

Oracle Block: This is smallest logical unit in the oracle database. size of the oracle block is fixed for a tablespace, you can say it is fixed across all tablespace in a database, generally it is 8 KB. There could be number of rows in single block, but when session request for row it will fetch whole block from disk into db buffer cache, similarly when row or column is changed in db buffer cache, the DBWn will write whole block back into datafile from which it came, overwrites original one.
Size is defined by DB_BLOCK_SIZE which can never be modified once database is created.

Physical view:

Datafile: This is physical entity made up of number of operation system blocks. structure between datafile and operating system block totally depends on operating system file system.

for example -

MS-DOS FAT file system- file size upto 4GB only.
NTFS (windows), ext3(Linux)- no practical limit
Raw devices /ASM : popularity of raw devices is getting lesser day by day due to manageability issue and automatic storage management.

Operating System Block : unit of I/O for file system.  operations wise it looks same as oracle block, if process wants only one byte from disk but I/O will have to read while os block. default operating system block size is 512B to 1KB depending on devices used.


 

Identifying physical location of segments extents

First commands create new table techon_user.techon_tb
second query shows it has just one extent (number 0), it’s in file 5, size is 8 block long starting from block number 97, size of extent is 64KB,

Third query allocates another extent to segment. next query shows new extent number 1 though first is not full. 
Last query shows physical location of file id 5..

techondba-oracle-extents-segments-allocate-tablspace


Comment below in case additional information is required.

  • Share This:  
  •  Facebook
  •  Twitter
  •  Instagram
  •  Pin
  •  linkedin
  •  reddit
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Author

Atikh Shaikh
View my complete profile

Categories

  • MongoDB (18)
  • Oracle 12c (30)
  • Oracle12cR2 New Feature (3)
  • PostgreSQL (20)
  • RMAN (10)
  • Snowflake (8)
  • mysql (23)
  • oracle (74)

Blog Archive

  • ▼  2018 (38)
    • ►  November (25)
    • ▼  December (13)
      • Starting and Stopping MongoDB
      • Oracle Database Architecture Physical and Logical
      • MongoDB Database Backup and Restore
      • Startup and Shutdown Oracle Database
      • Oracle 12c New features – Multitenant Database
      • MongoDB Storage Engines
      • Create Pluggable Database (PDB) in Oracle 12c
      • Warning: PDB altered with errors- opening PDB in O...
      • Oracle 12c: Starting and Stopping PDB
      • Know your Hostname in MySQL
      • Everything you need to know about Oracle Data Pump
      • List Databases, Tables, schemas and other basic c...
      • User Managed Backups in Oracle
  • ►  2019 (33)
    • ►  January (15)
    • ►  February (6)
    • ►  March (2)
    • ►  April (5)
    • ►  May (5)
  • ►  2020 (5)
    • ►  April (1)
    • ►  May (2)
    • ►  July (2)
  • ►  2021 (8)
    • ►  June (3)
    • ►  July (3)
    • ►  August (1)
    • ►  December (1)
  • ►  2022 (33)
    • ►  May (3)
    • ►  June (10)
    • ►  July (3)
    • ►  August (4)
    • ►  September (8)
    • ►  October (3)
    • ►  November (2)
  • ►  2023 (14)
    • ►  February (1)
    • ►  April (5)
    • ►  May (2)
    • ►  June (1)
    • ►  September (1)
    • ►  October (1)
    • ►  December (3)
  • ►  2024 (5)
    • ►  January (2)
    • ►  March (3)
  • ►  2025 (6)
    • ►  March (1)
    • ►  April (3)
    • ►  May (2)

Popular Posts

  • ORA-29283: invalid file operation: unexpected "LFI" error (1509)[29437]
    I was trying to export the schema in my windows PC, it got stuck with below error    C:\Users\shaik\Videos\technodba exp>expdp userid...
  • PostgreSQL : How to get data directory location for PostgreSQL instance
    Sometimes, you start working on a PostgreSQL instance but forget about the data directory, here we will discuss different methods to know th...
  • Oracle 23ai : Use of NOVALIDATE Constraints in IMPDP
    While performing impdp operations in the Oracle database, Oracle performs validation checks for every constraint on the imported table, that...
  • ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
    In previous articles, we have learned about user creation and grants  in MySQL in detail, but there are a few privileges called global priv...
  • Oracle Dataguard Broker Configuration (DGMGRL)
    Data Guard Broker is a command-line interface that makes managing primary and standby databases easy. DBA can use a single command to switch...

Labels

oracle Oracle 12c mysql PostgreSQL MongoDB oracle 19c Oracle23c oracle19c Orale PDB-CDB oracle12c python AWS Oracle ASM Virtualbox pluggable database storage engine

Pages

  • Disclaimer
  • Privacy Policy

Follow TechnoDBA

Copyright © Atikh's DBA blog | Powered by Blogger