Many businesses deal with high volumes of data, transactions, and clients daily but struggle to keep it all secure. This is where Oracle comes in. Oracle is a leading international software company in database management. Some of the largest global brands rely on Oracle to run their businesses, including FedEx, Dropbox, Zoom, and Spotify.
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 All About?
Oracle Database, also known as Oracle DB or Oracle RDBMS (relational database management system), 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 the retention of data, organizes it to allow for easy retrieval, and provides multiple users 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 (also known as a database instance) is the combination of memory and operating system processes that are a part of 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 a database may be mounted and opened by numerous instances through Real Application Clusters (RAC), while an instance may mount and open only one database (one set of files) at any point in 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, ever. In contrast, a database may be mounted and opened by one or multiple 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. SGA 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: manage memory structures, one by one receiving and sending information (also known as performing input/output (I/O)) to write data to a file on a disk. They also perform general maintenance tasks and monitor other Oracle Database processes to provide increased correspondence for more reliable performance.
Let’s break it down even further.
System Global Area (SGA)
The system 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 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 the 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 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 — automatically 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 writing of 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 the essential tasks of a database is to store data. There are two primary ways the database stores, and that is through 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: 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 contain metadata describing the physical structure (database name and locations of data files). Every database will have a control file.
- Online redo log files: consists of two or more online redo log files. An online redo log is 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: where Oracle stores data. Also known as logical blocks, Oracle blocks, or pages.
- Extents: a specific number of logically contiguous data blocks used to store a particular type of information.
- Segments: a set of extents allocated for storing database objects (a table or an index).
- Tablespaces: a logical container 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.
Hopefully, you now have a good overview of the Oracle Database architecture, its components, and how it can boost your business’s performance.