Many businesses deal with high volumes of data, transactions, and clients daily but struggle to keep them secure. This is where Oracle comes in. Oracle is a leading international software company in database management. Some of the largest global brands, including FedEx, Dropbox, Zoom, and Spotify, rely on Oracle to run their businesses.
Oracle Corporation offers multiple tech services, such as Database, Cloud, SaaS, etc. This article will focus on providing an overview of Oracle Database architecture.
What is Oracle Database?
Oracle Database, also known as Oracle DB or Oracle Relational Database Management System (RDBMS), is a system that stores, organizes, and retrieves data by type while maintaining relationships between all the various types of data.
Essentially, Oracle Database manages data retention, organizes it for easy retrieval, and provides multiple users with access to extensive amounts of data.
What does all of that mean? Oracle DB allows any business to manage and process data across networks securely. Let’s look at some of the core components in the Oracle architecture, starting with instance versus database.
Instance vs. database
As mentioned above, an Oracle Database is comprised of a database and at least one instance:
- Instance
An instance (a database instance) combines memory and operating system processes in a running installation. - Database
A database is a collection of files that hold data (data files, temporary files, redo log files, and control files).
A fundamental difference is that numerous instances may mount and open a database through Real Application Clusters (RAC). In contrast, an instance may mount and open only one database (one set of files) at any time.
The core distinctions between a database instance and an entire running database include:
- An instance is shared memory and a set of background processes. In contrast, a database is a stored collection of data.
- An instance can only mount and open one database. In contrast, a database may be mounted and opened by one or more instances using RAC.
A breakdown of Oracle instance architecture
Every running Oracle database is associated with one or many Oracle instances. Since an instance exists in memory and a database exists on disk, the two can live without one another. Let’s take a deeper dive into the architecture of an instance.
The three primary parts of an instance include:
- System Global Area (SGA): a group of shared memory structures (available to all processes) that contain data and control information for one database instance. SGAs are allocated when the instance starts up and released when it shuts down.
- Program Global Area (PGA): a private memory area (available to specific processes) allocated to each session when the session starts and released when the session ends
- Background Processes: are responsible for managing memory structures individually. They handle the reception and transmission of information, commonly referred to as performing input/output, which includes writing data to disk files. Additionally, these processes undertake general maintenance duties and monitor other Oracle Database processes to enhance communication and ensure reliable performance.
Let’s break it down even further.
System Global Area (SGA)
The system’s global area (SGA) is a memory area that starts with one or more background processes when an instance is created.
The SGA is responsible for:
- Caching data blocks read from a disk.
- Managing internal data structures that are accessed by multiple processes and threads simultaneously.
- Storing Structured Query Language (SQL) implementation plans.
- Buffering and writing redo data to the online redo log files.
The Oracle processes share the SGA, including server processes and background processes running on a single computer. How Oracle processes are associated with the SGA varies according to the operating system used.
A database instance includes multiple processes (background processes, server processes, and process memory). Even when server processes cease, the instance will continue to function.
Program Global Area (PGA)
The program global area (PGA) is a memory area that retains data and controls information for a server process.
The PGA is:
- Responsible for processing SQL statements and holding logon and other session data.
- Dedicated to SQL “work areas.” Work areas are active memory areas for sorts and other SQL operations.
When an Oracle server process is started, a nonshared memory is created. The Oracle server has exclusive access to the PGA process, and each server process has only one PGA. However, background processes distribute their own PGAs. The type of server used (dedicated server or shared server) will determine the contents of the PGA and the amount of memory used.
The sum of PGA memory distributed to all background and server processes in a database instance is called the total instance’s PGA memory. The collection of all individual PGAs is called the total instance PGA or instance PGA.
Primary background processes
An Oracle instance operates several background processes, including:
- Process Monitor (PMON)
PMON is a live process in a database that regulates all other processes, cleans up unnaturally bound database connections, and automatically registers a database instance with a listener process. - System Monitor (SMON)
SMON is a process that performs system-level clean-up operations. It has two primary responsibilities — automatic instance recovery if an instance has a power failure and cleaning up temporary files. - Database Writer (DBWn)
The DBWn process analyzes data from the disk and writes it back to the disk. An instance can have many database writers (DBW0, DBW1, DBW2, etc.). - Checkpoint Process (CKPT)
The CKPT process updates the headers of the control and data file with checkpoint information and cues for writing dirty buffers to disk. - Log Writer Process (LGWR)
The LGWR is the key to the recoverability architecture. It writes and logs every change that occurs in the database out to a file called “redo log” for recovery purposes. The LGWR process starts with writing changes to the memory and then to the disk as “redo logs” that can be used for recovery. - Archiver Process (ARCn)
The ARCn copies the content of redo logs to archive the files. The archiver process can have multiple processes (ARC0, ARC1, and ARC3, etc.), which allow the archiver to write to various destinations. - Manageability Monitor Process (MMON)
The MMON gathers performance metrics. - Memory Manager (MMAN)
The MMAN automatically controls memory inside a database. - Listener Registration Process (LREG)
The LREG registers information on the database instance and dispatcher processes with the Oracle Net Listener.
A breakdown of Oracle Database architecture
An Oracle Database is a compilation of data that stores and retrieves related information. The database has logical structures and physical structures. Because the physical and logical structures are separate, the physical hub of data can be managed without affecting the access to logical storage structures.
One of a database’s essential tasks is to store data. The database stores data in two primary ways: a physical and logical storage structure.
Physical storage structures
The physical storage structures are simply files that store data. When you execute a [create database] statement to create a new database, Oracle creates three files:
- Data files
Data files contain real data (sales orders and customer data). The data of logical database structures, such as tables and indexes, are physically stored in the data files. - Control files
Control files contain metadata describing the physical structure (database name and locations of data files). Every database will have a control file. - Online redo log files
Online redo log files consist of two or more files. They are made up of redo entries that record all changes made to the data. Every database will have an online redo log.
A database includes multiple other vital files as well, such as parameter files, network files, backup files, and archived redo log files that assist with backup and recovery.
Logical storage structures
Oracle Database uses a logical storage structure for fine-grained control of disk space usage. The four logical storage structures in a database are:
- Data blocks
This is where Oracle stores data. Also known as logical blocks, Oracle blocks, or pages. - Extents
Extents are a specific number of logically contiguous data blocks used to store a particular type of information. - Segments
Segments are a set of extents allocated for storing database objects (a table or an index). - Tablespaces
Tablespaces are logical containers for a segment. Each tablespace consists of at least one data file.
Improve business performance using databases
Businesses today have access to more data than ever before, thanks to the massive data collection from the Internet of Things (IoT). Databases are available to forward-thinking organizations that can use them to analyze vast quantities of information from various systems. By utilizing databases and other business tech tools, organizations can leverage the data they collect to operate more efficiently, improve decision-making, and scale their business.
You now have a good overview of the Oracle Database architecture, its components, and how it can boost your business’s performance.