Physical Vs
Physical Vs
logical storage
Oracle database architecture depends upon two types of storage: physical and logical.
Physical (disk) storage contains all the files in the database. Logical storage structures, such
as tablespaces, segments, extents, and blocks, appear on the disk but are not part of the
dataset. Logical storage helps users locate specific data and improves the efficiency of the
retrieval process, enabling a modular data storage system in which capacity can be adjusted
without affecting performance.
A book serves as a helpful analogy for the difference between physical and logical storage. A
book's contents are printed on paper (physical storage), but additional information in the form
of chapters, page numbers, and footnotes (logical storage) helps readers navigate the book
and its contents.
Logical storage is the contextual information that appears in the book, but isn't part of the
book's story. Rather, it's a guide to help you find specific information or mark your place
Databases exist on disk, while instances reside in memory and run as processes. Memory
structures store data and metadata. Processes help run the database, enable communication
between various components, and keep the data between memory and disk in sync.
Processes
While memory structures contain information, processes control what happens within the
data server. Put another way, processes determine the series of steps that are applied to the
data. Oracle Database processes can be organized into four primary categories:
Client processes — allow client applications to connect to the server and run its code.
Server processes — bridge the client and the database. In dedicated server mode, a
server caters only to one client. In shared server mode, a server can cater to multiple
clients simultaneously.
Memory structures
Oracle Database stores in memory information that includes program code, sessions, locking
details, and program execution requirements, along with data. Oracle organizes this
information into four distinct areas:
System global area (SGA): Every Oracle database instance has one SGA. The data
inside SGA is shared across multiple processes and sessions. Examples of data stored
here include cached data and shared SQL.
Program global area (PGA): PGA contains data and control information, exclusive
to each process. A process such as database log writer has details specific to its logs in
its PGA.
User global area (UGA): UGA is memory allocated exclusively for a session. As a
user session ends, its UGA is deleted. When you connect to a database instance and
execute SQL commands and transactions, these happen inside your UGA. In
dedicated server mode, UGA is stored inside PGA, whereas in a shared server mode,
UGA is stored inside SGA.
Code areas: These are memory areas used to store and run code.
Note: If you lose Datafiles, you lose your database. The extension for datafiles is .dbf
Control Files:
Control files stores metadata about the data files and online redo log files like names, locations,
timestamp, and status. This information is required by the database instance to start and open
the database.
Note: If you lose Control Files, you lose your database. The extension for Control files is .ctl
Note: If you lose Redo log files, you lose your database. The extension for the redo log file is .log
Database Backups Files:
Any backups of your database that you have taken to be stored in any location to recover the
database when the database is crashed.
Note: The backup must include the data files, control files, and redo log files to recover because
these are the important database files.
Parameter file:
There are two parameter files.
1. Pfile
2. Spfile
This file defines how the database instance is configured when it starts up. All the configurations
of the database are present in the parameter file.
Note: The spfile is a binary file, you cannot edit it directly, it should be done by using oracle
commands. Pfile is a parameter file. You can edit again. If you lose the spfile no issue, you can
recreate it again. But it is better to take a backup of the spfile in order to restore all the
configurations of the database.
Password File:
It stores passwords for users with administrative privileges (sys user) in order to connect
remotely. Sys user has all the privileges to the database.
Note: DBA password cannot be stored in the database, because Oracle cannot access the
database before the instance is started, Therefore, the authentication of the DBA must happen
outside of the database. The password file will be present in the below location:
$ORACLE_HOME \database\ PWD sid. ora(sid is database name)
Trace File:
Each server and background process writes to a trace file. When a process detects an internal
error, it writes information about the error to its trace file.
Location of Trace file: /oracle/diag/rdbms/dotnet_db1/dotnet_db1/trace/ and the file name
would be *.trc
In the next article, I am going to discuss Oracle Database Storage Structures in detail. Here, in
this article, I try to explain Oracle Database Files and I hope you enjoy this Oracle Database
Files article.