Share

Oracle Database 23ai key innovations with examples

Oracle Database 23ai is the latest long-term support release, and its name explicitly highlights its core focus: Artificial Intelligence. The “ai” suffix signifies a fundamental shift, embedding AI capabilities directly into the heart of the database to handle modern data and application needs.

Key innovations can be categorized as follows:

1. AI Vector Search

This is the flagship feature of 23ai. While traditional databases excel at finding exact matches, Vector Search finds similarities. It allows you to store and search unstructured data (like text, images, audio) by converting them into mathematical representations called vectors.

What it does: It enables semantic search, going beyond keyword matching to understand the meaning and context of your query.

Example: An E-commerce Product Search

Imagine a user searches for: “comfortable, cotton dresses to wear at the beach in summer.”

  • Traditional SQL Query: Would look for products containing the exact keywords “comfortable”, “cotton”, “dresses”, “beach”, “summer”. It might miss a relevant product titled “Breezy summer linen tunic for the seaside” because it doesn’t share the exact keywords.

  • Vector Search Query:

    1. The user’s query is converted into a vector (e.g., [0.85, -0.42, 0.33, ...]) using an AI model.

    2. All product descriptions have been pre-processed and stored as vectors in the database.

    3. The database performs a nearest-neighbor search to find the product vectors most similar to the query vector.

    4. Result: It returns semantically similar products like “Breezy summer linen tunic” or “Lightweight vacation maxi dress,” even if they don’t contain the original keywords.

How to do it (Simple Code Example):

-- 1. Add a vector column to your table</span><br><br>
ALTER TABLE products ADD(product_description_vector VECTOR);

-- 2. Generate and store a vector for a product description
UPDATE products
SET product_description_vector = vector_embedding(
using model oci_ai_model_name,
for 'Breezy summer linen tunic for the seaside'
)
WHERE product_id = 123;

-- 3. Search for similar products based on the vector
SELECT product_name, product_description
FROM products
ORDER BY vector_distance(product_description_vector,
vector_embedding(using model oci_ai_model_name, for 'comfortable cotton dresses to wear at the beach in summer'))
FETCH FIRST 5 ROWS ONLY;

 

2. Enhanced JSON Support

23ai dramatically improves how you work with JSON documents, merging the flexibility of NoSQL with the power and robustness of SQL.

What it does: It allows you to query JSON data as easily as you query traditional relational tables, using simple dot notation.

Example: Querying Customer Data Stored as JSON

Assume customer data is stored in a JSON column named data.

-- Traditional approach (more cumbersome):<br>
SELECT c.data->'$.name' as customer_name<br>
FROM customers c<br>
WHERE JSON_EXISTS(c.data, '$.address.city')<br>
AND c.data->'$.address.city' = 'Istanbul';

-- Oracle 23ai approach (MUCH SIMPLER):
SELECT c.data.name as customer_name
FROM customers c
WHERE c.data.address.city = 'Istanbul';
-- You can directly traverse the JSON structure using dot notation, just like a relational column.

3. Transactional Property Graphs

This feature is designed to model and analyze complex relationships (networks or graph structures) within your data, all with full ACID transaction support.

What it does: It’s ideal for fraud detection (“find suspicious financial cycles”), recommendation engines (“people who bought this also bought…”), and social network analysis (“friends of friends”).

Example: Fraud Detection in a Financial Institution

  • Entities (Vertices): CustomerAccountTransaction

  • Relationships (Edges): OWNSSENT_FROMSENT_TO

-- Find a potential money laundering cycle: Did money from Customer A go to B, then to C, and back to A?
SELECT *
FROM MATCH (a:Customer) - [:OWNS] -> (acc1:Account)
- [:SENT_FROM] -> (tx1:Transaction) - [:SENT_TO] -> (acc2:Account)
- [:OWNS] -> (b:Customer)
ON financial_graph
WHERE a.customer_id = 123
AND b.customer_id != a.customer_id;
-- This kind of multi-hop relationship analysis is very complex and slow with traditional SQL JOINs but becomes intuitive and performant with graph queries.

 

4. True Cache

True Cache is an automatically managed, read-only replica located close to application servers.

What it does: It offloads read-intensive workloads (like reporting and dashboards) from the primary database. This ensures that heavy analytical queries don’t impact the performance of critical transactional operations.

Example: A News Website

The “Most Read Articles” widget on a homepage is updated frequently and read millions of times per second. Directing all this read traffic to the primary database can slow it down. By routing these queries to a True Cache, the primary database remains free to handle update operations, while read queries are served with extremely low latency.

5. SQL & Developer Productivity Enhancements

23ai introduces numerous quality-of-life improvements to the SQL language.

  • IF [NOT] EXISTS Clause: Prevents errors when creating or dropping objects.

    DROP TABLE IF EXISTS temp_table; -- No error if the table doesn't exist.
  • ANSI-Standard JOIN Syntax in UPDATE Statements:

    UPDATE orders o
    SET o.delivery_address = m.address
    FROM customers m
    WHERE o.customer_id = m.id;
  • DOMAIN Support: Enforces data integrity rules across multiple columns.

    CREATE DOMAIN email_domain AS VARCHAR2(100)
    CONSTRAINT check_email CHECK (REGEXP_LIKE(value, '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'));
    
    -- Now use the domain in table definitions
    CREATE TABLE customers (
        id NUMBER,
        email email_domain -- This column must now obey the email pattern
    );

Summary

Oracle Database 23ai is a transformative release that converges the capabilities needed for modern applications into a single, powerful data platform. It seamlessly integrates AI (Vector Search), NoSQL flexibility (JSON), Relational Analysis (Graphs), and Extreme Performance (True Cache). Its goal is to eliminate the need for multiple, specialized databases, thereby simplifying architecture and dramatically boosting developer productivity.

Loading

You may also like