Introduction to Oracle AI Database

This chapter provides an overview of Oracle AI Database.

This chapter contains the following topics:

About Information Systems

Every organization has information that it must store and manage to meet its requirements. For example, a corporation must collect and maintain human resources records for its employees. This information must be available to those who need it.

An information system is a formal system for storing and processing information. A database is an organized collection of information treated as a unit. The purpose of a database is to collect, store, and retrieve related information for use by database applications.

When database systems were first invented they were designed for a specific workload. Over the years it has become apparent that single-purpose databases no longer satisfy all requirements: in addition to relational workloads, developers needed to store data in other formats such as XML, spatial, graph, JSON, and most recently, vector data for the AI age.

Oracle AI Database has developed from a relational database engine to a converged engine, allowing developers to store almost any type of data in the format their application requires natively, and fully integrated into its enterprise-grade architecture.

Database Management System (DBMS)

A database management system (DBMS) is software that controls the storage, organization, and retrieval of data.

Typically, a DBMS has the following elements:

A database application is a software program that interacts with a database to access and manipulate data. Oracle AI Database was one of the first database engines to support the relational model. Since its inception it has evolved into a converged database engine, supporting almost any data type and many diverse workloads.

Relational Model

In his seminal 1970 paper “A Relational Model of Data for Large Shared Data Banks,” E. F. Codd defined a relational model based on mathematical set theory. Today, the most widely accepted database model is the relational model.

A relational database is a database that conforms to the relational model. The relational model has the following major aspects:

A relational database stores data in a set of simple relations. A relation is a set of tuples. A tuple is an unordered set of attribute values.

A table is a two-dimensional representation of a relation in the form of rows (tuples) and columns (attributes). Each row in a table has the same set of columns. A relational database is a database that stores data in relations (tables). For example, a relational database could store information about company employees in an employee table, a department table, and a salary table.

Related Topics

Relational Database Management System (RDBMS)

The relational model is the basis for a relational database management system (RDBMS). An RDBMS moves data into a database, stores the data, and retrieves it so that applications can manipulate it.

An RDBMS distinguishes between the following types of operations:

Oracle AI Database is an RDBMS at its core. An RDBMS that implements object-oriented features such as user-defined types, inheritance, and polymorphism is called an object-relational database management system (ORDBMS). Oracle AI Database extends the relational model to an object-relational model, making it possible to store complex business models in a relational database. Over time, Oracle’s core data engine has evolved to a much more powerful model now referred to as a converged database.

Converged Database Architecture

Oracle AI Database is a converged database that supports multiple data models and workloads in a single database engine. In addition to relational data, it can manage JSON documents, graph data, spatial data, text, vectors, and other specialized data types.

These capabilities share common database services, including transactions, security, backup and recovery, high availability, auditing, and query optimization. Applications can therefore use different data models without requiring a separate database for each one.

For example, an application can store customer and transaction data in relational tables, flexible attributes in JSON documents, geographic information as spatial data, and vector embeddings for semantic search. SQL can be used to query and combine these forms of data in a single operation. A document-style API is available for developers who prefer this NoSQL style.

A converged database provides the following benefits:

Convergence does not require every workload to use every capability or to reside in one physical database. Applications can use only the features they need. Oracle’s flexible architecture allows developers to spread applications over multiple pluggable databases.

Oracle Database remains relational at its core. Its converged architecture extends that foundation so that applications can work with multiple data models while using a common set of database services catering for almost all workloads.

Schema Objects

One characteristic of an RDBMS is the independence of physical data storage from logical data structures.

In Oracle AI Database, a database schema is a collection of logical data structures, or schema objects. A database user owns a database schema, which has the same name as the user name.

Schema objects are user-created structures that directly refer to the data in the database. The database supports many types of schema objects, the most important of which are tables and indexes. Users who prefer a document-style API to access their data can create (JSON) collections, or JSON-relational duality views.

A schema object is one type of database object. Some database objects, such as profiles and roles, do not reside in schemas.

Related Topics

Tables

A table describes an entity such as employees.

You define a table with a table name, such as employees, and set of columns. In general, you give each column a name, a data type, and a width when you create the table.

A table is a set of rows. A column identifies an attribute of the entity described by the table, whereas a row identifies an instance of the entity. For example, attributes of the employees entity correspond to columns for employee ID and last name. A row identifies a specific employee.

You can optionally specify a rule, called an integrity constraint, for a column. One example is a NOT NULL integrity constraint. This constraint forces the column to contain a value in every row. Constraints spanning multiple tables can be defined as SQL assertions. Prior to Oracle AI Database 26ai you could use database triggers to enforce business logic as part of a transaction.

Related Topics

Indexes

An index is an optional data structure that you can create on one or more columns of a table. Indexes can increase the performance of data retrieval.

When processing a request, the database can use available indexes to locate the requested rows efficiently. Indexes are useful when applications often query a specific row or range of rows.

Indexes are logically and physically independent of the data. Thus, you can drop and create indexes with no effect on the tables or other indexes. All applications continue to function after you drop an index.

Related Topics

Data Access

A general requirement for a DBMS is to adhere to accepted industry standards for a data access language. Note: JavaScript requires Oracle 26ai running on Linux x86-64 or Linux aarch64.

Structured Query Language (SQL)

SQL is a set-based declarative language that provides an interface to an RDBMS such as Oracle AI Database.

Procedural languages such as C describe how things should be done. SQL is nonprocedural and describes what should be done.

SQL is the ANSI standard language for relational databases. All operations on the data in an Oracle database are performed using SQL statements. For example, you use SQL to create tables and query and modify data in tables.

A SQL statement can be thought of as a very simple, but powerful, computer program or instruction. Users specify the result that they want (for example, the names of employees), not how to derive it. A SQL statement is a string of SQL text such as the following:

SELECT first_name, last_name FROM employees;

SQL statements enable you to perform the following tasks:

SQL unifies the preceding tasks in one consistent language. Oracle SQL is an implementation of the ANSI standard. Oracle SQL supports numerous features that extend beyond standard SQL.

Related Topics

PL/SQL, Java, and JavaScript

PL/SQL is a procedural extension to Oracle SQL. Java and JavaScript are additional options that you can use to store business logic in the database.

PL/SQL is integrated with Oracle AI Database, enabling you to use all of the Oracle AI Database SQL statements, functions, and data types. You can use PL/SQL to control the flow of a SQL program, use variables, and write error-handling procedures.

A primary benefit of PL/SQL is the ability to store application logic in the database itself. A PL/SQL procedure or function is a schema object that consists of a set of SQL statements and other PL/SQL constructs, grouped together, stored in the database, and run as a unit to solve a specific problem or to perform a set of related tasks. The principal benefit of server-side programming is that built-in functionality can be deployed anywhere.

Oracle AI Database can also store program units written in Java and JavaScript. A Java stored procedure is a Java method published to SQL and stored in the database for general use. You can call existing PL/SQL programs from Java and JavaScript, and Java and JavaScript programs from PL/SQL.

Multilingual Engine (MLE) offers you the ability to write business logic in JavaScript and store the code in the database as MLE Modules. Functions exported by MLE Modules can be exposed to SQL and PL/SQL by means of Call Specifications. These call specifications are PL/SQL units (functions, procedures, and packages ) and can be called anywhere PL/SQL is called.

Related Topics

NoSQL APIs for Document Access

Simple Oracle Document Access (SODA) is a set of NoSQL-style APIs for managing document collections, particularly JSON documents, in Oracle AI Database. Applications can create collections and insert, retrieve, update, delete, and query documents without requiring knowledge of SQL or the underlying database schema.

SODA provides a document-centric programming model based on collections, documents, and query-by-example filters. This is the opposite to SQL, which provides a declarative, set-oriented interface for querying and modifying relational data and can express joins, aggregations, and operations across multiple data types.

SODA is useful when an application primarily works with JSON documents and requires a simple document API, and it can be an alternative for developers who want to use a NoSQL API.

Developers porting document workloads to Oracle AI database from a third-party, single-purpose data store have the option to use the Mongo DB API for Oracle AI Database, which is similar to SODA but aimed at making migrations easier. In the simplest case, changing the application’s connection string from the single-purpose data store to Oracle AI Database is all that needs to be done.

Transaction Management

Oracle AI Database is designed as a multiuser database. The database must ensure that multiple users can work concurrently without corrupting one another’s data.

Transactions

A transaction is a logical, atomic unit of work that contains one or more SQL statements.

An RDBMS must be able to group SQL statements so that they are either all committed, which means they are applied to the database, or all rolled back, which means they are undone.

An illustration of the need for transactions is a funds transfer from a savings account to a checking account. The transfer consists of the following separate operations:

  1. Decrease the savings account.

  2. Increase the checking account.

  3. Record the transaction in the transaction journal.

Oracle AI Database guarantees that all three operations succeed or fail as a unit. For example, if a hardware failure prevents a statement in the transaction from executing, then the other statements must be rolled back.

Transactions are one feature that set Oracle AI Database apart from a file system. If you perform an atomic operation that updates several files, and if the system fails halfway through, then the files will not be consistent. In contrast, a transaction moves an Oracle database from one consistent state to another. The basic principle of a transaction is “all or nothing”: an atomic operation succeeds or fails as a whole.

Related Topics

Data Concurrency

A requirement of a multiuser RDBMS is the control of data concurrency , which is the simultaneous access of the same data by multiple users.

Without concurrency controls, users could change data improperly, compromising data integrity. For example, one user could update a row while a different user simultaneously updates it.

If multiple users access the same data, then one way of managing concurrency is to make users wait. However, the goal of a DBMS is to reduce wait time so it is either nonexistent or negligible. All SQL statements that modify data must proceed with as little interference as possible. Destructive interactions, which are interactions that incorrectly update data or alter underlying data structures, must be avoided.

Oracle AI Database uses locks to control concurrent access to data. A lock is a mechanism that prevents destructive interaction between transactions accessing a shared resource. Locks help ensure data integrity while allowing maximum concurrent access to data.

Related Topics

Data Consistency

In Oracle AI Database, each user must see a consistent view of the data, including visible changes made by a user’s own transactions and committed transactions of other users.

For example, the database must prevent the dirty read problem, which occurs when one transaction sees uncommitted changes made by another concurrent transaction.

Oracle AI Database always enforces statement-level read consistency, which guarantees that the data that a single query returns is committed and consistent for a single point in time. Depending on the transaction isolation level, this point is the time at which the statement was opened or the time the transaction began. The Oracle Flashback Query feature enables you to specify this point in time explicitly.

The database can also provide read consistency to all queries in a transaction, known as transaction-level read consistency. In this case, each statement in a transaction sees data from the same point in time, which is the time at which the transaction began.

Related Topics

Oracle AI Database Architecture

A database server is the key to information management.

In general, a server reliably manages a large amount of data in a multiuser environment so that users can concurrently access the same data. A database server also prevents unauthorized access and provides efficient solutions for failure recovery.

Database and Instance

An Oracle database server consists of a database and at least one database instance , commonly referred to as simply an instance.

Because an instance and a database are so closely connected, the term Oracle database sometimes refers to both instance and database. In the strictest sense, the terms have the following meanings:

Multitenant Architecture

The multitenant architecture enables an Oracle AI Database to be a CDB.

Every Oracle AI Database must contain or be able to be contained by another database. For example, a CDB contains PDBs, and an application container contains application PDBs. A PDB is contained by a CDB or application container, and an application container is contained by a CDB.

Starting in Oracle Database 21c, a multitenant container database is the only supported architecture. In previous releases, Oracle supported non-container databases (non-CDBs).

Container Databases

A CDB contains one or more user-created PDBs and application containers.

At the physical level, a CDB is a set of files: control file, online redo log files, and data files. The database instance manages the files that make up the CDB.

The following figure shows a CDB and an associated database instance.

Figure 1: Database Instance and CDB

Description of the illustration cncpt233.png

Pluggable Databases

A PDB is a portable collection of schemas, schema objects, and nonschema objects that appears to an application as a separate database.

At the physical level, each PDB has its own set of data files that store the data for the PDB. The CDB includes all the data files for the PDBs contained within it, and a set of system data files that store metadata for the CDB itself.

To move or archive a PDB, you can unplug it. An unplugged PDB consists of the PDB data files and a metadata file. An unplugged PDB is not usable until it is plugged in to a CDB.

The following figure shows a CDB named MYCDB.

Figure 2: PDBs in a CDB

Description of the illustration cncpt352.png

Physically, MYCDB is an Oracle AI Database, in the sense of a set of data files associated with an instance. MYCDB has one database instance, although multiple instances are possible in Oracle Real Application Clusters, and one set of database files.

MYCDB contains two PDBs: hrpdb and salespdb. As shown in Figure 1-2, these PDBs appear to their respective applications as separate, independent databases. An application has no knowledge of whether it is connecting to a CDB or PDB.

To administer the CDB itself or any PDB within it, you can connect to the CDB root. The root is a collection of schemas, schema objects, and nonschema objects to which all PDBs and application containers belong.

Application Containers

An application container is an optional, user-created container within a CDB that stores data and metadata for one or more applications.

In this context, an application (also called the master application definition) is a named, versioned set of common data and metadata stored in the application root. For example, the application might include definitions of tables, views, user accounts, and PL/SQL packages that are common to a set of PDBs.

In some ways, an application container functions as an application-specific CDB within a CDB. An application container, like the CDB itself, can include multiple application PDBs, and enables these PDBs to share metadata and data. At the physical level, an application container has its own set of data files, just like a PDB.

For example, a SaaS deployment can use multiple application PDBs, each for a separate customer, which share application metadata and data. For example, in the following figure, sales_app is the application model in the application root. The application PDB named cust1_pdb contains sales data only for customer 1, whereas the application PDB named cust2_pdb contains sales data only for customer 2. Plugging, unplugging, cloning, and other PDB-level operations are available for individual customer PDBs.

Figure 3: SaaS Use Case

Description of the illustration cncpt389.png

Globally Distributed Database Architecture

Oracle Globally Distributed Database (formerly called Oracle Sharding) is a database scaling technique based on horizontal partitioning of data across multiple PDBs. Applications perceive the pool of PDBs as a single logical database. Each partition is called a shard.

Key benefits of sharding for applications include linear scalability, fault containment, and geographical data distribution. Globally Distributed Database is well suited to deployment in the Oracle Cloud. Unlike NoSQL data stores that implement sharding, Globally Distributed Database provides the benefits of sharding without sacrificing the capabilities of an enterprise RDBMS.

In a sharding architecture, each CDB is hosted on a dedicated server with its own local resources: CPU, memory, flash, or disk. You can designate a PDB as a shard. PDB shards from different CDBs make up a single logical database, which is referred to as a sharded database. Two shards in the same CDB cannot be members of the same sharded database. However, within the same CDB, one PDB could be in one sharded database, and another PDB could be in a separate sharded database.

Horizontal partitioning involves splitting a database table across shards so that each shard contains the table with the same columns but a different subset of rows. A table split up in this manner is also known as a sharded table. The following figure shows a sharded table horizontally partitioned across three shards, each of which is a PDB in a separate CDB.

Figure 4: Horizontal Partitioning of a Table Across Shards

Description of the illustration admin_3v_134a.png

A use case is distributing customer account data across multiple CDBs. For example, a customer with ID 28459361 may look up his records. The following figure shows a possible architecture. The customer request is routed through a connection pool, where sharding directors (network listeners) direct the request to the appropriate PDB shard, which contains all the customer rows.

Figure 5: Oracle Globally Distributed Database Architecture

Description of the illustration admin_3v_143d.png

Related Topics

Database Storage Structures

A database can be considered from both a physical and logical perspective.

Physical data is data viewable at the operating system level. For example, operating system utilities such as the Linux ls and ps can list database files and processes. Logical data such as a table is meaningful only for the database. A SQL statement can list the tables in an Oracle database, but an operating system utility cannot.

The database has physical structures and logical structures. Because the physical and logical structures are separate, you can manage the physical storage of data without affecting access to logical storage structures. For example, renaming a physical database file does not rename the tables whose data is stored in this file.

Physical Storage Structures

The physical database structures are the files that store the data.

When you execute a CREATE DATABASE command, you create a CDB. The following files are created:

When you execute a CREATE PLUGGABLE DATABASE command within a CDB, you create a PDB. The PDB contains a dedicated set of data files within the CDB. A PDB does not have a separate, dedicated control file and online redo log: these files are shared by the PDBs.

Many other files are important for the functioning of a CDB. These include parameter files and networking files. Backup files and archived redo log files are offline files important for backup and recovery.

Related Topics

See Also: “Physical Storage Structures”

Logical Storage Structures

Logical storage structures enable Oracle AI Database to have fine-grained control of disk space use.

This topic discusses logical storage structures:

Related Topics

Database Instance Structures

An Oracle database uses memory structures and processes to manage and access the CDB. All memory structures exist in the main memory of the computers that constitute the RDBMS.

When applications connect to a CDB or PDB, they connect to a database instance. The instance services applications by allocating other memory areas in addition to the SGA, and starting other processes in addition to background processes.

Oracle AI Database Processes

A process is a mechanism in an operating system that can run a series of steps. Some operating systems use the terms job, task, or thread.

For the purposes of this topic, a thread is equivalent to a process. An Oracle database instance has the following types of processes:

Oracle processes include server processes and background processes. In most environments, Oracle processes and client processes run on separate computers.

Related Topics

Instance Memory Structures

Oracle AI Database creates and uses memory structures for program code, data shared among users, and private data areas for each connected user.

The following memory structures are associated with a database instance:

Related Topics

Application and Networking Architecture

To take full advantage of a given computer system or network, Oracle AI Database enables processing to be split between the database server and the client programs. The computer running the RDBMS handles the database server responsibilities while the computers running the applications handle the interpretation and display of data.

Application Architecture

The application architecture is the computing environment in which a database application connects to an Oracle database. The two most common database architectures are client/server and multitier.

Client-Server Architecture

In a client/server architecture, the client application initiates a request for an operation to be performed on the database server. The server runs Oracle AI Database software and handles the functions required for concurrent, shared data access. The server receives and processes requests that originate from clients.

Multitier Architecture

In a multitier architecture, one or more application servers perform parts of the operation. An application server contains a large part of the application logic, provides access to the data for the client, and performs some query processing. In this way, the load on the database decreases. The application server can serve as an interface between clients and multiple databases and provide an additional level of security.

A service-oriented architecture (SOA) is a multitier architecture in which application functionality is encapsulated in services. SOA services are usually implemented as Web services. Web services are accessible through HTTP and are based on XML-based standards such as Web Services Description Language (WSDL) and SOAP. Oracle AI Database can act as a Web service provider in a traditional multitier or SOA environment.

A microservices architecture divides an application into small, independently developed and deployed services. Each service owns its business logic and, ideally, its data, reducing coupling and allowing teams to scale, update, and operate services independently.

Oracle multitenant architecture maps naturally to the database-per-service pattern. Each microservice can use its own pluggable database (PDB), providing a separate data, security, and administrative boundary while multiple PDBs share the resources of a common container database (CDB).

This approach combines service isolation with efficient consolidation. PDBs can be provisioned, cloned, patched, backed up, relocated, and scaled independently, while administrators retain centralized control of the underlying database infrastructure.

Related Topics

Oracle Net Services Architecture

Oracle Net Services are the interface between the database and the network communication protocols that facilitate distributed processing and distributed databases.

Communication protocols define the way that data is transmitted and received on a network. Oracle Net Services supports communications on all major network protocols, including TCP/IP, HTTP, FTP, and WebDAV. Oracle Net, a component of Oracle Net Services, establishes and maintains a network session from a client application to a database server. After a network session is established, Oracle Net acts as the data courier for both the client application and the database server, exchanging messages between them. Oracle Net can perform these jobs because it is located on each computer in the network.

An important component of Net Services is the Oracle Net Listener (called the listener), which is a process that runs on the database or elsewhere in the network. Client applications send connection requests to the listener, which manages the traffic of these requests to the database. When a connection is established, the client and database communicate directly.

Oracle REST Data Services

Oracle REST Data Services (ORDS) provides an HTTPS gateway to Oracle AI Database. It enables applications to expose tables, views, stored procedures written in PL/SQL, JavaScript and Java, and custom database operations as secure REST APIs, often without requiring a separate application server or extensive middleware code.

ORDS also supports the Oracle Database API for MongoDB, allowing applications to use compatible MongoDB drivers, tools, and commands to access JSON document collections stored in Oracle Database. The MongoDB wire protocol is translated into database operations through ORDS, enabling REST, MongoDB, and SQL applications to work with data managed by the same converged database.

Related Topics